Tagged: x
-
AuthorPosts
-
June 22, 2016 at 12:32 am #1053780
tashitendrelParticipantHi,
In order to add previous/next navigation to the portfolio item pages I have added this code from some advice given on this forum (https://community.theme.co/forums/topic/single-post-next-previous-arrow-navigation-like-ethos/) to my functions.php in renew child team:
add_action (‘the_content’, ‘add_next_post_item_link’ );
function add_next_post_item_link ( $content ) {
if ( is_singular(‘post’) || is_singular( ‘x-portfolio’ ) ) {
$next_name = “Next Post <i class=\”x-icon-chevron-right\”></i>”;
$prev_name = “<i class=\”x-icon-chevron-left\”></i> Previous Post”;
$next_link = get_next_post() ? ‘ID ) . ‘”>’ . $prev_name . ‘‘ : ”;
$prev_link = get_previous_post() ? ‘ID ) . ‘”>’ . $next_name . ‘‘ : ”;
$posts = ‘<div class=”wp-post-navigation-next”>’.$next_link.$prev_link.'</div>’;
return $content . $posts;
} else {
return $content;
}
}It looks OK, however incially the code was written for blog posts and I changed the line: if ( is_singular(‘post’) || is_singular( ‘x-portfolio’ ) ) {. Also, maybe it was meant for Ethos theme?
Anyway, I have 2 issues with it now:
– the previous/next appeares also in the SHARE THIS area in the sidebar. I would like to remove it from here. Screenshot attached
– only on the mobile the navigation shows up on the top of the sidebar instead below portfolio item desctription. And again, it doubles in the SHARE IT area. Second screenshort attached.What should I change in this code?
thank youJune 22, 2016 at 12:42 am #1053791
tashitendrelParticipantJust noticed that on the vertical tablet view of Appearance it looks the same like on mobile – navigation comes inside the sidebar area.
June 22, 2016 at 3:39 am #1053958
ChristopherModeratorHi there,
Please add following code in Customize -> Custom -> CSS :
.entry-extra .wp-post-navigation-next { display: none; } @media (max-width:767px){ .entry-extra { margin-top: 72px !important; } }Hope that helps.
June 22, 2016 at 8:57 am #1054336
tashitendrelParticipantthank you!
June 22, 2016 at 9:25 am #1054378
ThaiModeratorYou’re most welcome 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1053780 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
