Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #165588

    robert v
    Participant

    Hi,

    I’m sorry, but the portfolio navigation has issues.

    if you go here:

    http://studiohetzwarteschaap.nl/testsite3/voorbeelden/

    and pick the first one (via ‘lees meer’), and try to navigate, you get stuck in this particular portfolio item. (Leidinggeven voor facility managers)

    If you access another item, you can skip to this particular portfolo item, and then it hangs again.
    It seems the navigation cannot get passed through the last posted portfolio item.

    I’ve tested this:
    – all plugins switched off (accept VC and x-shortcodes) – no difference
    – deleted the last portfolio item (in which it seems to happen – now another postfolio item is ‘last post’ and same thing happens.)

    I’ve tried all the codes you gave me, (with and without the class or portfolio +blog together) but every piece of code seems to have this effect.

    #165745

    Zeshan
    Member

    Hi Robert,

    As the (Leidinggeven voor facility managers) is the newest post and there is no post after it, that’s the reason of this issue. You can replace the previous provided code from your functions.php file with following:

    // Adding Next Post/Porfolio Link to Single pages
    // =============================================================================
    
    add_action ('the_content', 'add_next_portfolio_item_link' );
    
    function add_next_portfolio_item_link ( $content ) {
       if ( (x_is_portfolio_item() || is_singular('post')) && !get_next_post() == '' ) {
          if ( x_is_portfolio_item() ): $name = "Next Portfolio Item";
          elseif ( is_singular('post') ): $name = "Next Post";
          else: $name = ""; endif;
          $posts = '<div class="wp-post-navigation-next"><a href="' . get_permalink( get_next_post()->ID ) . '">' . $name . '</a></div>';
          return $content . $posts;
       } else {
          return $content;
       }
    }
    
    

    This code won’t show any link on the newest post.

    Thanks!

    #165857

    robert v
    Participant

    Ok, I really appreciate the support, but things are getting alot worse now. Total confusion…

    The last post looks fine, but when i go to another portfolio-item, all tekst is completely scrambled.
    Like this:
    http://studiohetzwarteschaap.nl/testsite3/voorbeelden/workshop-voor-medewerkers-rechtbank/
    Also the posts (under ‘nieuws’) are suffering from these strings of code everywhere thoughout the tekst.

    And there is another problem i’ve discovered with the portfolio:

    The portfolio category selection button isn’t showing.
    When i change the slug from ‘voorbeelden’ back to ‘portfolio-item’, the button gets back to the upper-right part of the page, like it should.

    Eventhough the portfolio is selected as the lay-out; no portfolio items show up. (their standard images do, and they aren’t completely visible, nor can i click it to access the item itself)

    i also notice that on the portfolio page, named with the slug ‘voorbeelden’ (so the one without the cat-filter), isn’t showing me an ‘edit page link’ when im logged in. also i see the VC page builder (back-end button) in that page.

    to make it stranger….when i write Voorbeelden (so with capital) as the portfolio slug, all messages appear (like its on the site now…(but without the category selection)

    What am i doing wrong here?

    I’ve used this theme 4 times before, never had these problems.

    #165911

    robert v
    Participant

    Ok, the slug issue is solved.

    I used the same name for the page as the ‘slug name’, so that caused the weirdness. (the portfolio items showed up with the same styling as blogposts)

    cat. selection is working, and the items are visible, because i added a featured image.
    I was confused, because the items first showed up as blogposts (thinking, they would show up like that because there was no featured image selected)

    so the only problem that remains is the code throughout the portfolio (voorbeelden) and the blogposts.

    #165990

    robert v
    Participant

    i’ve tested it out, and this:

    var_dump(get_next_post());

    was causing all the jibber jabber on the pages.

    the code below seems to works fine:

    add_action (‘the_content’, ‘add_previous_portfolio_item_link’ );

    function add_previous_portfolio_item_link ( $content ) {
    if ( (x_is_portfolio_item() || is_singular(‘post’)) && !get_previous_post() == ” ) {
    if ( x_is_portfolio_item() ): $name = “Vorig voorbeeld”;
    elseif ( is_singular(‘post’) ): $name = “Vorig bericht”;
    else: $name = “”; endif;
    $posts = ‘<div class=”wp-post-navigation-pre”>ID ) . ‘”>’ . $name . ‘</div>’;
    return $content . $posts;
    } else {
    return $content;
    }
    }

    add_action (‘the_content’, ‘add_next_portfolio_item_link’ );

    function add_next_portfolio_item_link ( $content ) {
    if ( (x_is_portfolio_item() || is_singular(‘post’)) && !get_next_post() == ” ) {
    if ( x_is_portfolio_item() ): $name = “Volgend voorbeeld”;
    elseif ( is_singular(‘post’) ): $name = “Volgend bericht”;
    else: $name = “”; endif;
    $posts = ‘<div class=”wp-post-navigation-next”>ID ) . ‘”>’ . $name . ‘</div>’;
    return $content . $posts;
    } else {
    return $content;
    }
    }

    peace out!

    #166077

    Zeshan
    Member

    Hi Robert,

    I’m really sorry about that! It seems, I missed removing that line of code which was added for testing purposes. Removing it should be good. I’m glad to see that you’ve sorted it out by yourself 🙂

    Let us know if you have any question, we’ll be happy to assist 🙂

    Thank you.