More posts section

Mauer Themes Support Storyteller More posts section

This topic contains 4 replies, has 2 voices, and was last updated by  dzukis 2 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #262

    dzukis
    Participant

    Hello support,

    How i can exclude one category from “more posts” section in bottom of all posts (single)

    I want to disable category: homecat showing here > http://prntscr.com/bm7vuw

    http://www.myscratchpost.com/

    Thanks in advance!

    #268

    Paul
    Keymaster

    Hello,

    To exclude a category from the ‘More posts’ section you need to modify the query by which it’s being formed in single.php (the $args array around line 62). Here are the possible category parameters described in the Codex.

    So, for instance, to exclude a category with the id of 20 you would do the following:

    $args = array(
     'post_type' => 'post',
     'post__not_in' => array(get_the_ID()),
     'posts_per_page' => 2,
     'category__not_in' => array( 20 ),
    );

    Please mind that it’s best to perform such modifications in a child theme, so that they do not get overwritten during a theme update.

    #273

    dzukis
    Participant

    Hello Sir,

    Yeah, that works pretty good. Thank you very much.

    I have one more question. When I added your template (demo content) i got homepage with shortcodes (i think occurs to layout i choose> 2 columns or 3 columns grid…). But I removed them. Is there anywhere where I can find all shortcodes I can use to build home page or it is a fixed layout, if you understand me?

    Cheers!

    #274

    Paul
    Keymaster

    I’m glad it worked out for you.

    As for the shortcodes, there are no shortcodes created by this theme. What you saw might have been the [gallery] shortcode (which comes with WordPress) or shortcodes created in your content by a previous theme.

    #276

    dzukis
    Participant

    To be honest, im not sure what I saw. Thank you again for your time and help!

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘More posts section’ is closed to new replies.