Questions tagged [featured-post]
The featured-post tag has no usage guidance.
100 questions
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, ...
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 = "...
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 ...
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 ...
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:
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 ...
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 ...
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 ...
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 ...
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="&...
-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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 !
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() {
...
-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 ...
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 ...
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 ...
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 ...
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 = [
'...
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 ...
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.
...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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('...
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 ...
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 ...
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 ...
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 -->
...
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 ...
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() ) ...
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
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.
...
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....
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... ...
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:...
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 ...
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"...
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 ...