How to change featured content to a different tag in WordPress Twenty Fourteen?

In twenty fourteen theme, we’d like to know how to change the features content tag. Currently it’s set as featured. Now, we would like to know how to code this for different page templates. We notice in page.php there is a piece of code calling the template part featured-content. <?php if ( is_front_page() && twentyfourteen_has_featured_posts() … Read more

Include a specific post to the query_posts and remove it if it is already in the returned list

Bare with me. Firstly, here is my whole script for my featured slider articles: <div id=”featured” class=”<?php if ( $responsive ) echo ‘flexslider’ . $featured_auto_class; else echo ‘et_cycle’; ?>”> <a id=”left-arrow” href=”#”><?php esc_html_e(‘Previous’,’Aggregate’); ?></a> <a id=”right-arrow” href=”#”><?php esc_html_e(‘Next’,’Aggregate’); ?></a> <?php if ( $responsive ) { ?> <ul class=”slides”> <?php } else { ?> <div id=”slides”> … Read more

How to get relative URL of medium sized featured image?

How to show featured image (medium sized) relative URL (relative to the website root)? I need something like this: uploads/214/07/image-600×400.png I tried with this: if ( has_post_thumbnail()) { $medium_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘medium’); echo $medium_image_url[0]; } It works fine, I get path of medium sized featured image, but with domain name too, and I need … Read more

Get the size (size in Kb or MB) of an featured image?

I need to display some featured image info on post page. Among other info I need to display file size of image (featured image of post). I tried this function inside single.php. <?php function getSize($file){ $bytes = filesize($file); $s = array(‘b’, ‘Kb’, ‘Mb’, ‘Gb’); $e = floor(log($bytes)/log(1024)); return sprintf(‘%.2f ‘.$s[$e], ($bytes/pow(1024, floor($e)))); } ?> and … Read more

Display featured products through custom loop in WooCommerce 3 [closed]

Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for WordPress Development Stack Exchange. Closed 5 years ago. Improve this question I was wondering if someone could help me. I am trying to display featured products using a custom loop. Before WooCommerce … Read more

Three different post types on homepage

Update: Thank you for the answer but after implementing this code it’s breaking the theme/site. I’m sure it’s me but here’s my functions.php file: // Custom posts for homepage function get_featured_one() { /* returns post #1 */ } function get_featured_two() { /* returns posts #2 and #3 */ } add_action( ‘pre_get_posts’, function( $query ) { … Read more