New Landing How can we help? Themeforest Theme Support Flexform restrict nav links in blog page-builder element to the same category

Viewing 8 posts - 1 through 8 (of 8 total)
  • Posted in: Flexform
  • #3640
    brianfogel
    Member
    Post count: 22

    Hello I’m adding posts to the bottom of a page using the Blog page-builder element.  Can I can restrict the display of nav-previous and nav-next links in DIV class=”pagination-wrap blog-pagination” to posts that belong to the same category (or categories) as the current post?

    For example, although a post belongs only to the “A” category there is a nav-next link to a post that belongs to the “C” category.  I want people to be able to navigate within this blog element only to posts sharing the same category.

    #3700
    Cosmin – SUPPORT
    Member
    Post count: 3851

    Hi,

    Having it hidden on particular posts would need advanced custom coding, with which we can’t help unfortunately. I suggest hiring a freelancer to custom code it.

    Regards,

    ————————————————————————————————————

    Cosmin
    Support Assistant

    #3725
    brianfogel
    Member
    Post count: 22

    Thanks very much for your answer.  I am a javascript and PHP coder.  Is there online info that could direct me to the appropriate locations in the codebase?  That would give me a head start?

    #3837
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    You can do this quite easily actually, just edit single.php and change line 304-307:

    <div class="pagination-wrap blog-pagination clearfix">
    	<div class="nav-previous"><?php next_post_link('%link', __('<i class="icon-angle-left"></i> <span class="nav-text">%title</span>', 'swiftframework'), TRUE); ?></div>
    	<div class="nav-next"><?php previous_post_link('%link', __('<span class="nav-text">%title</span><i class="icon-angle-right"></i>', 'swiftframework'), TRUE); ?></div>
    </div>

    Hope that helps.

    – Ed

    #3892
    brianfogel
    Member
    Post count: 22

    Thanks, that was easy and it restricts navigation to posts in the same category.  However, this apparently works only if posts belong to a single category.  If any belong to multiple categories they don’t obey.  I guess there’s something more complicated going on with those.  Do you have any idea how to make this really, truly strict?

    #3920
    Cosmin – SUPPORT
    Member
    Post count: 3851

    That’s why I was saying it requires advanced theme customizations.

    You would need to custom code a meta field for your posts, where you could specify if the nav links should show up or not. Something similar to what we have for the post options; you could add an option with a dropdown per post, to choose yes/no for the nav links.

    If you’re familiar with WordPress development, you can take a look at our options framework and eventually add your own option in there.

    Regards,

    ————————————————————————————————————

    Cosmin
    Support Assistant

    #4241
    brianfogel
    Member
    Post count: 22

    Cosmin, I am new to WordPress development but this is a good a time as any to get started.  Are you referring to the WordPress options framework or one created by swiftideas?

    #4291
    Cosmin – SUPPORT
    Member
    Post count: 3851

    Hi Brian,

    Our theme options are a hybrid of Options Framework, custom shortcodes, custom Page Builder code and custom meta boxes added to the WordPress admin pages.

    You would need to tie a custom coded theme option together with a custom coded meta box that you would add to post edit screens.

    Regards,
    ————————————————————————————————————

    Cosmin
    Support Assistant

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register