Okay
  Public Ticket #1126001
Looping Projects
Closed

Comments

  • William started the conversation

    I would like the next and previous project links to loop. First goes to last, last to first... currently they stop.

    I found a post in the kalium discussion on envato who had this inegrated into their site but the code is incomplete and this is for an earlier version of kalium.

    <>

    Open this file:

    /kalium/tpls/portfolio-single-prevnext.php

    Then paste code on line 27:

    if ( function_exists( 'CPTOrderPosts' ) ) {
        remove_filter( 'posts_orderby', 'CPTOrderPosts', 99, 2 );
    }
    if ( ! $prev ) {    
        $ids = get_posts( array( 'post_type' => 'portfolio', 'fields' => 'ids', 'order' => 'DESC', 'orderby' => 'menu_order' ) );
        $prev = get_post( reset( $ids ) );
    }
    if ( ! $next ) {    
        $ids = get_posts( array( 'post_type' => 'portfolio', 'fields' => 'ids', 'order' => 'ASC', 'orderby' => 'menu_order' ) );
        $next = get_post( reset( $ids ) );
    }

    <>

    Also on mobile my next and previous links (this way + that way) are showing up as emojis? I want to have these as text links.

  • [deleted] replied

    Hi William,

    In the first (or last post), click Edit portfolio item and assign a "manual" next and previous links, this is the only way to make next/prev navigation loop. I have recorded a video for you:

    http://drops.laborator.co/rAZ1

    I hope this will help you.