Skip to main content

Questions tagged [featured-post]

Filter by
Sorted by
Tagged with
33 votes
3 answers
36k views

Can I exclude a post by meta key using pre_get_posts function?

I see many people prefer to use pre_get_posts hook instead of query_posts. The code below works and shows all posts which have meta key "featured" function show_featured_posts ( $query ) { if ( $...
Carlisle's user avatar
  • 351
3 votes
1 answer
7k views

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 ...
Advanced SEO's user avatar
0 votes
1 answer
64 views

featuring old articles without messing up with the archive

This is all about featuring content in WP. Say, you got 1000's of posts that you accumulated over the years and each has their own original ( and true ) post dates. And now you want to feature them ...
Average Joe's user avatar
  • 1,889
24 votes
10 answers
94k views

Display featured products through custom loop in woocommerce on template page

I would like to display 6 featured products from my woocommerce store on my home-page.php template. After some researched I found that the right way to do this was through a custom loop,( I do not ...
steamfunk's user avatar
  • 645
4 votes
2 answers
897 views

How to display Section for certain time

i am building a News site. I want to display 1 featured post from "prime" category for only few hours. after it should be expired or disappeared from the section. please have a look here u can see ...
Nisha_at_Behance's user avatar
1 vote
2 answers
438 views

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 ...
alex's user avatar
  • 133
0 votes
1 answer
339 views

set_post_thumbnail or media_sideload_image adds image multiple times in media library

I am trying to add the featured image to posts and that works, however, the featured image is apparently set everytime I check my post. <?php $post_id = get_queried_object_id(); $bla = "...
Johan's user avatar
  • 309
0 votes
1 answer
142 views

Broken pagination, need help figuring out why!

I just tried slapping together a poor-man's "featured post" section with this exact code out of my index.php: <div id="post-wrapper"> <?php if (is_home() && !is_paged()) : ?> ...
user avatar
0 votes
1 answer
50 views

Automated mark posts as featured every day

Hello Wordpress Community, I want to build myself a "recipe of the day" functionality. I'm looking for a way to mark 3 Custom Post Types per day as "Featured Posts" by a plugin or Cronjob. The ...
Fargho's user avatar
  • 117
0 votes
1 answer
2k views

Exclude most recent posts from specific category in wp_query()

I have a featured posts slider, which uses the 'featured' tag. I have a query for this which grabs the 3 most recent posts with this tag and shows them in the slider. Below this, I have a list of 10 ...
Tom Oakley's user avatar