WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Category based navigation > monolit theme with YAPB (3 posts)

  1. Pablo_MU
    Member
    Posted 3 years ago #

    Dear all,

    I'm currently asking for your kind help to help me go through the particular situation I'm in :)

    Headlines: I was doing a wp photoblog site for a friend and I just realized that we need a category based navigation instead of date based navigation.

    Front-end: http://www.monteauxphoto.com/portfolio
    WP: 3.1.2
    Theme: Monolit
    Plugins: Multi-level Navigation Plugin & Yet Another PhotoBlog

    Details: We have two buttons named "previous" and "next". Thing is, they follow an order by date and we need in fact a category order, meaning users can't leave the category without clicking in the desired category.

    Problem: I should understood this need since the beginning but I just realized that we don't have 'tons' of material (photos) to 'go through them in a timeline'.
    I'm not a php developer (shame on me) and I can't find in forums/site some threads or articles that could eventually lead to the solution to my problem.

    Other than that I love you community :)

  2. Pablo_MU
    Member
    Posted 3 years ago #

    Totally WHOA! :D

    I found it! Codex I love ya!

    The function is:

    Reference/get next post
    Description: Retrieve next post that is adjacent to current post.
    Usage: <?php get_next_post( $in_same_cat, $excluded_categories ) ?>
    Parameters:
    $in_same_cat
    (boolean) (optional) Whether post should be in same category.
    Default: false
    $excluded_categories
    (string) (optional) Excluded categories IDs.
    Default: ''

    Soooooooooooooooo As get_next_post() is located in wp-includes/link-template.php I opened and at line 1084 and changed $in_same_cat = true to $in_same_cat = false The thing looks now like:

    function get_next_post($in_same_cat = true, $excluded_categories = '') {
    	return get_adjacent_post($in_same_cat, $excluded_categories, false);

    OMG I'm so proud of me ;o)

  3. Pablo_MU
    Member
    Posted 3 years ago #

    typo!!!

    I meant:

    opened and at line 1084 and changed $in_same_cat = false to $in_same_cat = true

    false to true

Topic Closed

This topic has been closed to new replies.

About this Topic