-
How to Display Recent Article Title to Top New Bar of PHP WordPress Site from Specific ID
over 7 years ago
-
over 7 years ago
Hello Matt
For option 1:-
you can filter the posts by this code below, please put the code in the file where you are fetching posts :-
<?php $args = array( 'posts_per_page' => 5, 'offset' => 0, 'category' => 3, // Put the ID of category for which the posts you need 'category_name' => '', 'orderby' => 'date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_mime_type' => '', 'post_parent' => '', 'author' => '', 'author_name' =>'', 'post_status' => 'publish', 'suppress_filters' => true ); $posts_array = get_posts( $args ); ?> I hope I answered your question, Let me know, if this works
-
-
over 7 years ago
Hello Sir,
Your provided file has no enough code. Can you provide us the complete file or function where it is coming from.
Thank You
Deepak Verma -
2 Answer(s)