August 11, 2015 at 6:18 am
#27156
Theme Horse Support Team
Keymaster
Hi craig.haydon,
<?php $args = array(
'posts_per_page' => 5,
'offset' => 0,
'category' => '',
'category_name' => '',
'orderby' => 'date',
'order' => 'DESC',
'include' => '',
'exclude' => '',
'meta_key' => '',
'meta_value' => '',
'post_type' => 'post',
'post_mime_type' => '',
'post_parent' => '',
'author' => '',
'post_status' => 'publish',
'suppress_filters' => true
);
$posts_array = get_posts( $args ); ?>
You can use the above code and add the category name in 'category' => ''
View this link https://codex.wordpress.org/Template_Tags/get_posts
If you want to show different page with different category then you can create a template and then customize the code. Create a template and customize the code.
First of all create a child theme and then customize the code. Otherwise your customized code will be lost while updating to new version.
It needs lots of coding so you need to hire a developer. If you are good at coding then you can customize the code too.
Thank you!