0

I have used a custom page using this code, these links redirect to Category detail page which showing "Nothing Found". How can I show the clicked category related posts on category detail page? Note: I am using twentytwenty-child theme.

<?php /* Template Name: Our Jobs */ ?>
<?php get_header(); ?>


<?php wp_list_categories(array(
    'parent'        =>  '17',
    'show_option_all'    => '0',
    'orderby'            => 'name',
    'order'              => 'ASC',
    'style'              => 'list',
    'show_count'         => 1,
    'hide_empty'         => 1,
    'use_desc_for_title' => 0,
    'child_of'           => 0,
    'feed'               => '',
    'feed_type'          => '',
    'feed_image'         => '',
    'exclude'            => '',
    'exclude_tree'       => '',
    'include'            => '',
    'hierarchical'       => 0,
   'title_li'           => __( '<h2>' . __( 'heading' ) . '</h2>' ),
    'show_option_none'   => __( 'No categories' ),
    'number'             => null,
    'echo'               => 1,
    'depth'              => 0,
    'current_category'   => 0,
    'pad_counts'         => 0,
    'taxonomy'           => 'category',
    'walker'             => null
)); ?>

enter image description here

enter image description here

enter image description here

8
  • If the category indeed have post(s), then the archive page would list the posts in that category, and your code is just fine, so this is probably a plugin issue - have you tried deactivating plugins? Or maybe your child theme have a pre_get_posts or similar filter which hides the category posts?
    – Sally CJ
    Aug 23 '21 at 12:26
  • @SallyCJ thank you for answer, I will try this or may be I need to change some wp theme
    – dev
    Aug 25 '21 at 11:54
  • @SallyCJ I have installed only one plugin (Pods - Custom Content Types and Fields) for custom post type. After uninstalled it, clicked category related posts are not showing.
    – dev
    Aug 26 '21 at 2:28
  • In that case, try switching to the default theme (or the parent Twenty Twenty theme) and visit the category archive page (/category/job/accounts) and if the page is good, then the problem is with your child theme, and if you can share the files, I can help you check the code.
    – Sally CJ
    Aug 26 '21 at 8:45
  • designtlc.com/…
    – dev
    Aug 27 '21 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.