Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Flexform › restrict nav links in blog page-builder element to the same category
New Landing › How can we help? › Themeforest Theme Support › Flexform › restrict nav links in blog page-builder element to the same category
Tagged: adding, blog, categories, Category, element, example, I, Im, link, links, page, pagebuilder, people, post, posts, using
- This topic has 7 replies, 3 voices, and was last updated 11 years by Cosmin – SUPPORT.
-
Posted in: Flexform
-
May 2, 2013 at 5:38 am #3640
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.
May 2, 2013 at 2:28 pm #3700Hi,
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 AssistantMay 2, 2013 at 4:00 pm #3725Thanks 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?
May 3, 2013 at 3:42 pm #3837You 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
May 4, 2013 at 7:13 am #3892Thanks, 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?
May 4, 2013 at 1:48 pm #3920That’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 AssistantMay 8, 2013 at 7:18 am #4241Cosmin, 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?
May 8, 2013 at 3:17 pm #4291Hi 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 -
Posted in: Flexform
You must be logged in and have valid license to reply to this topic.