Questions tagged [recent-posts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
12 views

widget_posts_args not using the number of posts in widget

So I'm using the widget_posts_args filter to pull in my custom post type posts inside the core 'Recent Posts' widget. Here is the code: add_filter('widget_posts_args', function() { $params['...
0
votes
2answers
17 views

Custom recent-posts shortcode's thumbnail image not in line with rest of code

I'm making a custom recent-posts shortcode and I have a problem with the thumbnail image, it always shows it above everything else (permalink, title, etc...) even though I put it after in the code, is ...
0
votes
0answers
43 views

Linking to the most recent post in my podcast category

I am attempting to pulloff what the author did here: How can I link to the most recent post in a category? However, after updating my functions.php file in my child theme I can not get it to load the ...
0
votes
1answer
20 views

WordPress recent post

I have the static website template on the following domain : example.com and I have wordpress site in the sub domain : sub.example.com I want a code to get the latest post ( just post title ) from ...
0
votes
1answer
24 views

How to output only blockquotes content from recent posts in a widget?

I created a simple widget that displays recent post titles. How can I only display the content that is between < blockquote >< /blockquote > from recent posts? For example, all my posts have a ...
10
votes
5answers
94k views

How to display last 3 posts (recent posts) in a static page?

I would like to implement something like "recent posts" in a static page: http://themes.codehunk.me/insignio/ (at the footer) How I would be able to do this without a widget?
-1
votes
1answer
1k 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 ...
0
votes
2answers
421 views

How to display posts on template

I've added a page template that is my new home page and I would like to be able simply list the last 5 blog entries. My home page currently looks like... <?php /** * This file controls the ...
0
votes
0answers
27 views

Separate categories from my submenu and their latest posts

I have a menu with <? php wp_nav_menu() ?> in which I integrated a Walker menu to be able to display the latest posts for each category of my submenu! It works, but I would like to have the ...
0
votes
0answers
13 views

Add icon based on recent post to Blog submenu in wp_nav_menu

I am thinking of adding an icon to my Blog menu title in Wordpress. Like a red circle indicating there are new recent posts. The wp_nav_menu $link_after and $after attributes apply to all menu items ...
3
votes
2answers
538 views

How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?

I added the following to my functions.php: add_action('pre_get_posts', 'keyl_get_emp_posts'); function keyl_get_emp_posts($query) { if ($query->is_main_query()) $query->set('...
0
votes
2answers
21 views

2 column recent post query not respecting float right [closed]

I am trying to display recent posts where I have one on the left showing the image, title, excerpt and author info and on the right, just the title, date and author information. I want it to show the ...
0
votes
0answers
18 views

Display authors on most recent posts widget

I would like a widget which shows the author (or the authors, with coauthors_plus) below the most recent posts (along with their dates). Is it possible? I have been looking for it here and on Google ...
8
votes
2answers
36k views

Code for Recent Posts Widget

I want to make changes to code of the Recent Posts widget – could anyone please tell me where that code is located? Thank you in advance!
0
votes
0answers
19 views

Posts Per Page with a button to add more Posts

I have $recent_posts array with a 'posts_per_page' that look like thah: <?php $num_per_page = 3; $recent_posts = wp_get_recent_posts(array( 'posts_per_page' => $num_per_page, '...
2
votes
1answer
64 views

How to display recent / random posts by its category

trying to display random posts from each category that my custom post belongs to (it is related to 2 categories). I am trying to get post categories by id. I have tried to put category ID manually but ...
0
votes
2answers
121 views

menu item to display the most recent post

I spent most of the day reviewing past questions and answers and have not found anything that addresses what I am trying to do. Maybe I didn't word my search correctly. Lets say I have a category of ...
0
votes
3answers
882 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' ); ?>
-1
votes
1answer
10 views

Recent posts with different class name for each post and a scrollbar?

So far i found a widget ("Ultimate Posts Widget") with different class name for each post but it has no scroll bar.. any other widget suggestions ?
1
vote
1answer
4k 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
2answers
37 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 ...
1
vote
1answer
222 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 ...
2
votes
1answer
182 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
44 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 ...
2
votes
1answer
204 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
18 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
152 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
2answers
126 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
106 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 ...
2
votes
2answers
3k 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
2answers
560 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: ...
2
votes
1answer
5k views

How to hide a post from 'Recent Posts' widget?

I'm trying to hide a post from the 'Recent Posts' widget in the sidebar. I know I can do this with the 'Special Recent Posts' plugin, but that plugin really uses up a lot of resources. I've got the '...
0
votes
1answer
413 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
84 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 ...
3
votes
2answers
5k views

Display all comments or recent comments per user on author page

I have author pages for each author and I want to see all of their comments (or all of their recent comments) if I click on their nickname. How can I do this? I tried the beneath code, but that does ...
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
656 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
507 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
756 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
1answer
124 views

Where to add offset?

I want to use the offset function to skip the first post and I have this code inside which I need to put an offside=1 , but wherever I insert it, I receive the error...any idea where I can add it ...
0
votes
2answers
266 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
1answer
6k views

How to get excerpt of the recent posts

Right now, i am using code below to show title and its link of recent posts from my custom post category, but for one of my category i want to show excerpt, how can i achieve that. CODE i am using to ...
0
votes
0answers
736 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
600 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
869 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 ...
0
votes
1answer
1k 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
2answers
1k views

Display recent posts with thumbnail within Masonry

On a page-template, I need to display recent 10 posts. So I tried to use, wp_get_recent_posts, found here in the codex, which I think is an appropriate hook for the purpose.The rest of the code is ...
1
vote
1answer
149 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
53 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 &...
0
votes
1answer
2k views

Adding a badge to new blog post titles

I wish to add a small icon/badge left to my blog post titles those are new (maybe 5-7 days ago). I may preferably have a blinking gif image for this. Now, how to execute this? First I tried with this ...