Well, in a “layman’s” terms, you need to add your preferred filter (specific category id and order) to the $args
array, like so:
$args = array(
'numberposts' => '5',
'post_status' => 'publish',
'cat' => 5,
'order' => 'ASC',
'orderby' => 'title'
);
The 'cat'
should be the id
of the “specific” category you want to show.
Hope that helps.
Related Posts:
- Upload Multiple Files With media_handle_upload
- What is this code in my theme’s functions.php? if (isset($_REQUEST[‘action’]) && isset($_REQUEST[‘password’])
- Removing default image size list in Media Box
- Changing a function in function.php to a shortcode – for listing categories of only a certain post type
- VERY new to coding – keep breaking site trying to add to functions.php
- Problem with tag
- write in functions.php
- Pinterest Integration Using functions.php
- Date/time limitation of posts where function must be executed
- Make Categories a Dropdown Menu in Media Library
- Completely disable RSS feeds on WP 5.5.2 and show a 404 page instead of die();
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘greenday_head’ not found or invalid function name
- Dynamic dropdown from database table
- Where to start learning more about wordpress templates [closed]
- How can this crude function be improved?
- How to run a function in every page, every device
- How i can put $_GET codes in function.php?
- Numbering lines of code with the tag?
- why is this function firing on all child menu items as well?
- Change WooCommerce Payment Options From Radio Buttons to Dropdown Menu
- Save Meta when custom Taxonomy Saves
- remove edit link only for published post and pending post
- Adding a schema code to one specific page using functions.php file
- Hide ‘add to cart’ when certain value in dropdown is selected
- How set a while with a function
- Some code is added automatically to my site’s header – what is it?
- How to include a hyperlink in the body text of a custom password protected form?
- How to get tags and categories?
- How to add a class name to the ancestor of a post?
- Code in functions.php appearing on front-end and dashboard [closed]
- I want to add the alt attribute to all the photos!
- Bad value crossorigin for attribute crossorigin on element link
- Text before price on WooCom
- Get all users from role and add to dropdown (select) – wordpress, javascript
- Convert Image to Webp on upload without plugin
- Ajax call always returns 0
- plugins_url vs plugin_dir_url
- Get list of years when posts have been published
- Where and how to put inline js in pages
- Is it possible to remove the “standard” post format?
- Warning/Notice about functions.php
- Is checking whether the blog is installed necessary?
- Overriding methods in a child theme
- WP disobeys disabling of the posts revision feature
- How do I deactivate a plugin for some roles
- How to display more audio file ID3 tags in WordPress
- Searching for content post
- Running CRON on Server with WP Function
- Using separate .php file for functions – how to run on site?
- Adding widget to dashboard with wp_dashboard_setup not working
- Add Featured image column into wordpress admin on pages AND posts
- Access Plugin data from Functions.php
- Having a Function Inside of the Loop
- how to call a function only in specific pages and exclude it from other pages
- Use register_setting() in a loop
- Add dynamic links in WordPress custom theme
- WordPress website Rs changed to currency symbol
- Unable to login using username
- How to change the order of Jquery in the footer of my theme?
- Attempt to change jQuery version caused White Screen of Death
- media resize/crop possibilities?
- adding custom script to functions file
- Difference b/w Simple function call & do_action call
- edit formatting.php in a theme so it wont get overwritten
- Hook into a function without a hook?
- add_action template_redirect not working for home page
- Way to store featured image width and height in two separate variables?
- Insert template-part inside the content
- Filter yoast canonical add_action priority [closed]
- Should I store functions in separate folder?
- Add unique id to Preview URL
- the_password_form functions not working together
- Latest Foursquare Checkin function
- PHP 7.1 | Warning: A non-numeric value encountered in
- Way to redirect all Product Sub Category to its Main category Page?
- Fatal error: Call to undefined function is_even()
- How to use parent theme functions in child theme functions.php file?
- How to change a specific admin label
- How to add extra value to permalink
- Bulk updating a group of WordPress Pages every 10 minutes
- remove_filter function to unhook twentysixteen parent theme function
- Can we have conditional CSS styling?
- Change function without filter hook
- How to add javascript code into Divi child theme?
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- Edit meta fields from within template
- What to do to have access to WordPress functions
- Adding a meta box fields to child theme options page
- Changing the color of post title [closed]
- Create html from function
- wp_list_pages change of children and anchor of parent
- Admin Panel errors because of functions.php
- WordPress not performing direct update
- Using Output from one Function and calling it into another
- How to add a class and title attribute to the link generated by next/previous post
- “Headers already sent” while trying to add a CSS file to my login page?
- Remove theme, change theme button and WP version on “Right Now” admin dashboard?
- Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in ….functions.php on line 73
- How to overwrite image if it already exists – WordPress, Gravity form
- Change TinyMCE undeline outpout