Skip to main content

Questions tagged [featured-post]

Filter by
Sorted by
Tagged with
0 votes
0 answers
39 views

Make carousel slider from last 5 posts product from related category with prev and next button

I have more than 5 products in the same category. I want to display all related products in a slider form on a single product page. For desktop display, use the next and previous buttons. Meanwhile, ...
AW Soft's user avatar
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
0 answers
30 views

Need to add a post’s featured image to a section on the frontpage

It looks like I will need to create custom PHP code for this and either add it to my includes directory within a custom PHP file, or to the functions.php file. I need the ability to use a featured ...
Ron TheWebDev's user avatar
1 vote
0 answers
15 views

Display Featured Post by Categories and Avoid duplicated posts

I'm learning Wordpress development on Udemy and currently developing a theme. I haven't added any custom taxonomy but just using the "Post" and "Categories". Found a tutorial of ...
user3026483's user avatar
1 vote
0 answers
26 views

Media Gallery Upload photo incorrect way like glitch

I start having this issue like 3 days ago, I disable all plugins but nothing works. See the examples: Original photo: after I upload:
z00x's user avatar
  • 11
0 votes
2 answers
151 views

Get attachment thumbnail from get_posts function

How do I get the id of the most recent wordpress audio media upload. The reason for this is that I want to use audio cover images/ featured images as a post featured image. Do I need to retrieve the ...
9jaHob Media's user avatar
0 votes
0 answers
176 views

How to list blog post from subdirectory wordpress install to the main site

I have decided to separate my main website and my blog with different Wordpress installs. I've installed my blog in the subdirectory (/blog/ folder) and my main Wordpress is only contained homepage ...
Sham Shahar's user avatar
0 votes
0 answers
533 views

How to mark only one post as Featured post?

Am working on a blog page and I want to have a featured post as a banner. I have no idea how can I make only one post can be marked as the "Featured" so if another post is marked as "Featured" it ...
leonardeveloper's user avatar
0 votes
1 answer
300 views

How to display the featured post on the category page?

I have created a feature post check box on the post page. Now what I am doing is if any user-selected that checkbox then I have to show that post on the category page. I tried below code but it's not ...
Naren Verma's user avatar
0 votes
1 answer
37 views

Featured images duplicating and replacing next image

Took over a project, and one of the errors is the featured images (and certain others rendered in a similar way) are duplicating themselves and replacing the next image thumbnail. <a href="&...
Ranson Namba's user avatar
-1 votes
1 answer
29 views

Feature Image Showing Too Big

My feature images keeping showing up too large, I have tried to resize the images and re-upload but they are still showing up too big. I have tried to put in CSS code and gone onto Media setttings ...
emily's user avatar
  • 1
0 votes
1 answer
37 views

How do I link a featured photo to it's post?

I cannot change the url of the photo in the featured-image edit section. The page can be found at https://irregularus.com/tips-and-stories/ and if you click on the picture you will see that it just ...
Dylan Flannery's user avatar
0 votes
2 answers
34 views

How do I change the size of the feature picture of a single post?

Every time I select a featured photo for a single post, the size is always adjusted and it's massive. I have changed the size of the photo within WordPress, outside of WordPress, added code to ...
Dylan Flannery's user avatar
1 vote
3 answers
7k views

Gutenberg editor get post featured image by id

How can I show a post featured image by post id in gutenberg editor? I have a slider with latest posts and when I iterate through over posts I would like to show the post featured image as well. Here ...
fefe's user avatar
  • 894
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
1 vote
1 answer
59 views

Show Featured Post Only On The Homepage

Before the content/loop I have this featured post on the top. The problem is that it shows up in the other pages besides the home. I tried several solutions, but I am unable to hide it. Any help would ...
PauloP's user avatar
  • 51
0 votes
2 answers
274 views

WP site homepage displays url link at beginning of each featured post

Home page on my wordpress site displays url code before showing the text of my featured posts. They display normally once the post is called in their respective pages so the issue is just on the home ...
Marcela's user avatar
  • 11
0 votes
2 answers
246 views

Custom Post Type featured option

I have created a Custom Post Type called Products. Now I need a functionality that will allow me to select or check a product as featured. There can be only one featured product. When one product is ...
acoder's user avatar
  • 123
2 votes
1 answer
242 views

How to remove sticky post capability for a specific user role?

All is in the title. Does someone know a way to do that ? Thanks !
charlie's user avatar
  • 123
2 votes
0 answers
983 views

How do I create a function that simulate the click on Update button for all posts?

I made a child function.php with this code. All new posts will automatically use the attachment id for the image I have uploaded to my Media Library. function wpsites_auto_set_featured_image() { ...
Kees Jansen's user avatar
-1 votes
1 answer
5k views

How to show featured post first, then separate loop for other posts

I have followed the instructions from the Codex for multiple loops, but am having problems. I have a category called 'Featured' and a tag called 'Canada 2017' which are the posts I would like to ...
Chris L's user avatar
0 votes
2 answers
2k views

How to filter get previous post function by meta value DESC and post date DESC?

My loop displays featured posts and then posts in reverse chronological order. However when I use <?php echo get_previous_post(); ?> it grabs posts in reverse chronological order. How do I ...
Nick M.'s user avatar
0 votes
1 answer
347 views

Rotate featured post image

I am trying to have a s all box on my home page that will show the most recent 4 custom posts that are set with a featured tag. It is working and is showing the image of the most recent post and then ...
Sdesign's user avatar
  • 65
0 votes
1 answer
3k views

Debugging why featured images have stopped showing in WooCommerce on the homepage [closed]

At some point, the "Featured" images that usually showed up on our homepage have stopped showing. I've done some digging and found this template code in index.php (this is the Artificer theme by ...
Andrew Newby's user avatar
2 votes
1 answer
8k views

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

I was wondering if someone could help me. I am trying to display featured products using a custom loop. Before WooCommerce 3 I used following loop, which worked perfectly: <?php $args = [ '...
Christoph's user avatar
1 vote
2 answers
586 views

Adding a 'featured' class to certain posts

I would like users of my theme to be able to mark some posts as more important so that my theme can draw more attention to them. I'm not sure about the best way to go about this? Is it possible to ...
olliew's user avatar
  • 537
0 votes
0 answers
162 views

How can i link my featured image to be clicked and the file will be downloaded

Here, i have a modal, where it holds my featured image. What i want is, how can i link my featured image to a file/pdf so that if user clicks the featured image, then there will be a pdf downloaded. ...
Jc John's user avatar
  • 105
0 votes
2 answers
2k views

Remove any product that is featured from regular display loop [WooCommerce]

I have set up a custom loop to display featured products at the top of their relevant category pages. but now I would like to go about removing featured products from the regular loop below, which is ...
AlastairNixon's user avatar
3 votes
1 answer
113 views

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 ...
Garry Aylott's user avatar
0 votes
1 answer
103 views

Singleton Custom Field (Meta Box)

How do I create a custom meta box for posts which have a boolean data type and can be true only for one post. I want it to be falsified for all other posts when it's set on one post. Is there a hook ...
Merhawi Fissehaye's user avatar
0 votes
1 answer
43 views

Filter article that has featured image to shown on homepage [duplicate]

How do I display article that has featured image uploaded? I using premium theme. I found that all of the themes don't have this feature. Am I need to configure this in php file? Or there is ...
bingo bin's user avatar
  • 113
4 votes
1 answer
88 views

Add a single featured post to all pages?

Within wp-admin, we need the ability to select a single post as the featured post. This featured post will be displayed on all pages. I know I can make a post "sticky" but we would like to have only ...
shackleton's user avatar
0 votes
1 answer
268 views

Get template part with CPT and Custom Taxonomy conditionals

I have two Custom Post Types Video and Gallery and a Custom Taxonomy Status with the term Featured. Right now I'm showing these CPT in my index.php, but I want to style each of them, so I'm using ...
Ebenizer Pinedo's user avatar
3 votes
2 answers
4k views

Is there a hook / action that is triggered when adding or removing a post thumbnail?

I'm trying to update a custom field after a post thumbnail (Featured Image) is either added or removed from a post. The aim of this is to keep track of whether a featured image has been added or ...
Rick Curran's user avatar
  • 1,076
0 votes
3 answers
973 views

How to have a different section for a special category of posts in landing page?

I wish to have a different section for a certain category of posts displayed in the landing page of my WordPress website, while posts of various other categories display in an other section. Is this ...
Todo Pertin's user avatar
0 votes
1 answer
74 views

Add specific class to featured posts

Actually I'm using this loop to get my posts in homepage: <ul class="news"> <?php // The query $page = (get_query_var('paged')) ? get_query_var('...
Mattia Del Franco's user avatar
0 votes
1 answer
495 views

Featured-Content/Featured Posts With Random Order

I am working on dailysuit.de, which features four featured posts at the top, defined by a certain tag. The order is newest to oldest. How do I get this order randomised (and not newest to oldest)? I ...
vega's user avatar
  • 65
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
1 vote
1 answer
275 views

Using lower resolution/size images for thumbnails on posts index

In each of my post I set a feature image with a width of 800px. This is fine, however if I browse to the blog index page, which shows all posts (the feature image + an excerpt), then I end up with a ...
Sam's user avatar
  • 133
0 votes
2 answers
51 views

how do i make this loop work

Apologies I am a PHp beginner and I have no idea why this loop is not working on my tag.php page any help would be welcome. <?php get_header(); ?> <div class="posts"><!-- BLOG --> ...
luka's user avatar
  • 5
2 votes
1 answer
9k views

Find posts without featured image? [duplicate]

I need way to find post(s) without featured image set. I use WP as gallery site and for every post I set featured image. I wish to check if there is any post(s) without featured image. Any code to ...
Advanced SEO's user avatar
0 votes
2 answers
688 views

Prevent a query from duplicating

Trying to show featured posts on home using catID,but it is being duplicated. Is there any way to prevent it from duplicating: <?php query_posts("posts_per_page=1&cat=1"); if ( have_posts() ) ...
Dragut's user avatar
  • 173
0 votes
1 answer
64 views

Show image if a post is featured

I know that posts that are sticky show on top but I want to add an image to show that is featured is there any code I could use
Brittany Quake's user avatar
1 vote
2 answers
955 views

What is the best way mark entries as featured?

In quite a few wordpress projects I have a request in which Projects (or other post type) have to be featured in the Portfolio page (or other listing page) instead of the default date sorting lists. ...
Marc's user avatar
  • 357
0 votes
1 answer
93 views

Check if parent post is sticky on attachment page?

I use this code on post template (single.php) to check if current post is sticky: <?php if ( is_sticky() ) echo 'Post is sticky.'; ?> But it is not working on attachment page template (image....
Advanced SEO's user avatar
3 votes
2 answers
3k views

XMLRPC and Underscored custom fields

I was creating my application to automate all of my blogs from my desktop. Target, I'll post blog. That's all. I used XMLRPC service, as you know "xmlrpc.php". I built many of parts, near to done... ...
Erçin Dedeoğlu's user avatar
0 votes
1 answer
674 views

Display Custom Post if custom field is marked

I'm trying to get a custom post to show up on the front page only if a custom field I made is marked, otherwise it sould look for the one that is (and only one, not all marked). I currently have this:...
GuiHarrison's user avatar
5 votes
1 answer
1k views

Is "Featured Content" in Twenty Fourteen done with a plugin, or is it native in WP4.0?

I found that Twenty Fourteen offers users to have Featured Content on there websites. That's great, because I had written my own little script for such an occasion. But if the functionality is already ...
Bram Vanroy's user avatar
1 vote
2 answers
2k views

upload image only

I create post page from front end , and i add code for uplaod feature image. I use this code if (!function_exists('wp_generate_attachment_metadata')){ require_once(ABSPATH . "wp-admin"...
LET ME's user avatar
  • 31
1 vote
0 answers
70 views

Added Custom Post Type and the View Option Doesn't Work

I would like some pointers on fixing the Permalinks structure for a custom post type I added. Like many Custom Post Types this plugin uses the Custom Type Meta Box, and sets a featured image. All of ...
eyoung100's user avatar
  • 283