Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [recent-posts]

The tag has no usage guidance.

1
vote
1answer
24 views

Use wp_get_recent_posts with search term

I have a function that uses wp_get_recent_posts() I need to use this same function on my search page but am having problems adding the search parameter to the $args array. Does anyone know if this ...
0
votes
2answers
23 views

Is it possible to show thumbnails along with recent post from a wordpress blog on static website's homepage?

Please help me to figure this out that I want to show thumbnails along with recent post from a wordpress blog on static website's homepage. Following code are working fine but I need to show one ...
2
votes
1answer
42 views

If numberposts = -1 offset won't work

I have an issue with a shortcode I have built. The short code pulls the most recent posts based off of certain parameters. below are the parameters extract( shortcode_atts( array ( 'numberposts' ...
0
votes
1answer
26 views

Proper way to display latest 5 posts grouped by post type?

i need to display the latest 5 posts of each post type, something like: Latest BMW Posts: Post title BMW 1 Post title BMW 2 Latest Audi Posts: Post title Audi 1 Post title Audi 2 And so on. It ...
0
votes
0answers
29 views

how to add load more or pagination to recent post widget

i use "recent posts Widget With Thumbnails" plugin. this plugin not have any pagination or load more. please someon tell step by step what can do to add load more to this plugin. thanks
1
vote
1answer
19 views

How to display recent posts added in several custom post types

So I have several custom post types on my site and would like to have a place on my home page that will show the most recent 6 posts from 3 different custom post types. I have looked at the setup on ...
0
votes
1answer
12 views

'Recent Posts' links open in new window, without copying the 'WP_Widget_Recent_Posts' class

I have a requirement to have links on the 'recent posts' widget open in a new window (It's not something I would implement given the choice, but I've been asked to do it). I've found out that to ...
0
votes
1answer
31 views

Display recent post by tag

I have 6 related posts by tag in every post. But some tags have only 2 or 3 posts. So in these posts, related posts section shows only 2 or 3 post. I want to complete related posts (if not 6) with ...
0
votes
0answers
42 views

First Widget - Show Thumbnail Recent Posts

This is asked ans answered a lot of times in these forums, so I just wanted to check if I'm on the deep end with my solution or if it is valid. Reason for me not just picking a ready plugin is that ...
0
votes
3answers
372 views

Change recent posts widget title

How can i change the recent post widget title programmatically? I use this code in my footer.php to add recent posts widget. <?php the_widget( 'WP_Widget_Recent_Posts' ); ?>
0
votes
2answers
75 views

Display css ONLY on most recent post of specific category?

The below is just a scenario to provide context so you understand what im trying to accomplish, However please keep your answers related to the title if possible and a css solution/function. I have ...
0
votes
1answer
48 views

How to display Most Recently Read 10 Posts by a logged in user in wordpress

I'm wordpress newbie and working on a website where users can register and maintain their profile. One of the main function of the logged in users is displaying their most RECENTLY READ 20 or 10 ...
0
votes
2answers
38 views

How to start with post number x?

I have two areas where I fetch the most recent entries. In the first area, I want to get the first 10 posts. In the second area, I want to fetch the posts starting at post number 11.... I have this: ...
0
votes
1answer
303 views

How to filter wp_get_recent_posts() to only posts that have thumbnails?

I made a script that shows recent posts. But here's the problem, I want to show only posts that have thumbnails, and I want to show at least 10 posts if there are that many without thumbnails. So the ...
0
votes
1answer
64 views

Sort / display recent posts by publish date

I recently renovated some sites and made many small (usually typos) corrections to several posts. That of course changed the last update date, so that now, if I display recent posts in a widget, they ...
-1
votes
1answer
561 views

How to display recent posts on home page with title, post date, author and featured image?

I am looking to display some undecided number of recent posts (no more than 5) on my home page banner. For each post, I would like to display the title, post date, author and a featured images as ...
1
vote
2answers
44 views

Two posts are loaded instead of one?

I am trying to add a read posts function to my Wordpress website. To achieve this, I create a cookie on which I store all the IDs of read posts. Every time a post is loaded, the following function is ...
0
votes
1answer
322 views

Add hero image to home page (blog format) via the dashboard

I am looking to add a hero image to my site's home page (blog format) via the dashboard. I have successfully used Advanced Custom Fields (ACF) to add hero images to static pages and posts. However I'...
0
votes
2answers
222 views

Showing wordpress latest post thumbnails in slider with auto increment

I would like to show latest posts with its thumbnails only in slider. But my first figure element has a class. Can I apply a class to first thumbnail as it is in html structure below? And then Can I ...
1
vote
2answers
388 views

Recent Posts widget without Title

I want to add "Recent Posts" widget in a sidebar without a title but every time I add it, it shows "Recent Posts" text as title. How do I have it without title? I don't want to use any plugin for this....
0
votes
0answers
75 views

WP_Query or Simple Loop: The loops does not work in custom pages or template files

I have been trying to list a number of posts from a particular category in a custom template file. I used native loop, WP_Query and query_post. All of it returns 'home' as the result. In a custom ...
0
votes
0answers
38 views

Recent posts video in front page

I need ur help to the front page with recent videos post, I need to click on the thumbnail to open the video in a light box, which I did already in Archive.php but I can't do that on the front page. ...
0
votes
2answers
170 views

date_query problem

I'd like to get the closest post to today's post; yes, I checked and search this topic and found the code working for me: date_default_timezone_set("Europe/Warsaw"); setlocale(LC_ALL, en_GB); $year = ...
0
votes
0answers
587 views

Best way to add image to recent posts widget?

I want to add an image/thumbnail to the Wordpress recent posts widget. This is the only related question that I've seen and it uses filters and seems to be a bit round-about. I don't want to install ...
0
votes
1answer
355 views

Modifying recent post widget to include icons for post titles

I have downloaded a plugin from the wordpress repository which allows adding font icons to the titles of posts, you can select a different icon for individual posts according to preference. Now, the ...
-1
votes
1answer
729 views

How to filter content by language with WPGlobus

I am new in PHP and I cannot find the way or the programming logic to do this filter. I have the following code but I do not know how to filter it, Can anyone help me with the code? <?php ...
1
vote
2answers
2k views

Display Custom Post Type in Recent Posts

I have the following problem: I have created a custom post type matratze and currently besides the custom posts no other posts exist. Hence, nothing is being displayed under the recent posts. The ...
0
votes
1answer
770 views

How to add thumbnails from recent posts to owl-carousel in wordpress automatically?

This is the site that I am working with. I need to make the green images into recent post thumbnails, to be able to have a content writer/author (non developer) designate a thumbnail to display in the ...
1
vote
1answer
135 views

Single-post preview repeats thumbnails in Jupiter Recent Posts widget

I'm using the Jupiter theme version 5.1.8 with WordPress version 4.6. When I preview a single post, the thumbnails displayed by the Jupiter theme's Recent Posts widget are all repeats of the current ...
0
votes
1answer
48 views

Recent Posts Widget URL / Domain change

we use the "Recent Posts Widget" within our page footer. After we changed the site URL from development to live the links of the "Recent Posts Widget" didn't change. First we used the plugin "Search &...
2
votes
2answers
1k views

Add thumbnail to recent posts widget using filters

I want to add thumbnail to WordPress default recent posts widget, and I want to do it using any available filter. Is there any filter know to this subject/topic
0
votes
1answer
36 views

how to show post content with post name in sidebar?

I started working on a wordpress website, I need to show 20 words from every post with post name in Sidebar. I am new to wordpress, I am finding difficult to do it.
0
votes
1answer
2k views

Exclude latest post from WP_Query taxonomy term loop

Any help would be greatly appreciated! I have a Custom Post Type 'video', with a taxonomy 'tax-video' and I'm looping through posts in the sub-taxonomy term 't-o-t-w'. I need to exclude the latest/...
0
votes
1answer
205 views

Recent posts with featured image or fallback image with permalink

In my sidebar.php I have some code that prints the recent comments. I could not share the complete code here because of the formating restrictions. You can find the code here: https://codeshare.io/...
1
vote
1answer
3k views

meta_query not working properly

I'm trying to run a query that only displays items that meet a condition in an Advanced Custom Fields select box, but I'm getting nothing. Here's my query. Any help would be appreciated: <?php $...
0
votes
1answer
158 views

List recent posts with link to first category

I'm looking to get a list of the recent 4 posts and with it a link the the first (and only) category that the post is in. $args = array( 'numberposts' => '4', 'offset' => '0' ...
0
votes
1answer
45 views

Recent Posts widget has some older posts at the top? [closed]

I have this really weird issue I've never seen before and can't seem to google. I was adding some content to this site and noticed that the recent posts widget had about 8 or nice old posts constantly ...
0
votes
1answer
142 views

Posts modified in the last 48 hours

I am using the code below to generate posts created in the last 48 hours. function filter_where($where = '') { $where .= " AND post_date > '" . date('Y-m-d', strtotime('-2 days')) . "'"; ...
1
vote
1answer
3k views

Order posts by meta value and Date

I'm trying to sort posts based on one post meta value and date. I'm using this plugin ( https://github.com/JonMasterson/WordPress-Post-Like-System ) to add like system to my posts. The code that I'...
3
votes
1answer
4k views

Modify recent post sidebar to show post thumbs with out plugins

Hi i'm using undersocres to create a theme. I need to add post thumbnails to the recent post widget, but I'm stuck. I try the code below, but I get a duplicated recent post widget, one without ...
1
vote
1answer
417 views

Show one post per author and limit query to 8 posts

I want to show 8 recent products from multiple authors on the frontpage. Need to show 1 recent product per author. Currently i'm using basic wp query to show recent 8 products. $args = array ( '...
0
votes
1answer
863 views

Display recent posts on another site

I have created a recent post type plugin and it displays recent posts from another website, but the permalinks are not working properly. The permalink does not show the post's URL, it shows the same ...
0
votes
1answer
2k views

Add Date to Recent Posts Widget?

I am having an impossible time finding the proper way to add a date below the recent posts widget links. If anybody has a code, I would greatly appreciate it!
-1
votes
1answer
26 views

Help with “Recent Posts” Loop that is specific to a topic

I am getting more comfortable with WP but know zero PHP. I have a site up and running at www.wordpress-temporary.com that I am working on for a client. It's the twenty-twelve theme with some ...
0
votes
1answer
4k views

WP_Query with offset and 'orderby' => 'rand', offset not working

I have the following situation: on my index.php I am showing the most recent 20 posts using WP_Query(). On the same page in another section I would like to display 3 more random posts from the archive ...
0
votes
1answer
43 views

How to avoid duplicates when creating recent network posts

I'm using this code to get a list of custom posts (with custom fields) from the network for display in a php widget. It's old, but it's working fine: <?php switch_to_blog(4); ?> <?php $ca = ...
0
votes
1answer
108 views

Reset Wordpress Post Query to default

i am in a situation, i am creating a custom wordpress theme but i am stuck over something. in my index/home page, firstly i am displaying 6 posts by category like below <?php $posts = get_posts('...
0
votes
2answers
100 views

Why aren't paragraphs breaking on this page?

This page is created using a recent posts shortcode included with my theme. It is not displaying paragraph breaks that I've added in the editor and I'd like it to. How can I get the shortcode to ...
0
votes
1answer
210 views

Recent post in the middle of the content

My site has a static front page and a blog. I'm using the Foundation5 grid and I've split the content of the homepage onto three rows, like this, and I'm updating both the content and the html in the ...
0
votes
1answer
81 views

Small intro before latest blog posts

What I'm trying to achieve is quite simple (in my mind). On the homepage, my blog presents the list of latest posts and I'm ok with it. I just want to add an introduction (three lines of text) before ...