-
AuthorPosts
-
October 26, 2015 at 6:14 am #639787
Hi, how I can put next prev button on blog entries?
🙂
October 26, 2015 at 6:51 am #639835Hi there,
Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Please add this in child theme’s functions.php file :
function x_post_navigations () { previous_post_link( '<strong>%link</strong>','Previous' ); echo '|'; next_post_link( '<strong>%link</strong>','Next' ); } add_action ('x_after_view_renew_content', 'x_post_navigations'); add_action ('x_after_view_renew_content-audio', 'x_post_navigations'); add_action ('x_after_view_renew_content-gallery', 'x_post_navigations'); add_action ('x_after_view_renew_content-image', 'x_post_navigations'); add_action ('x_after_view_renew_content-link', 'x_post_navigations'); add_action ('x_after_view_renew_content-quote', 'x_post_navigations'); add_action ('x_after_view_renew_content-video', 'x_post_navigations');
Hope it helps.
October 26, 2015 at 9:54 am #640038Well, but is this happening
October 26, 2015 at 11:06 am #640121Hi there,
Do you want to add that option in the main Blog index page or Single Blog Posts? Please refer to the following implementation here (https://community.theme.co/forums/topic/single-post-next-previous-arrow-navigation-like-ethos/#post-341795).
Also you can use a plugin like WP Post Navigation (https://wordpress.org/plugins/wp-post-navigation/).
Thanks!
October 26, 2015 at 11:14 am #640133Thank you. Works
🙂
October 26, 2015 at 11:39 am #640158You’re most welcome 🙂
October 30, 2015 at 9:44 am #646330Please to do the same in PORTFOLIO ITEMS?
I’ve customized the file
x/framework/functions/global/content.php
` $left_icon = ‘<i class=”x-icon-arrow-left” data-x-icon=””></i><span class=”flechaIzquierda”> Anterior</span>’;
$right_icon = ‘<span class=”flechaDerecha”>Siguiente  </span><i class=”x-icon-arrow-right” data-x-icon=””></i>’;`But in the functions.php file of my childtheme, it would be better.
How I can do it like in the post?
🙂
October 30, 2015 at 2:00 pm #646651Hi there,
Please try to update the code to:
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() ? '<a style="float: left;" href="' . get_permalink( get_next_post()->ID ) . '">' . $prev_name . '</a>' : ''; $prev_link = get_previous_post() ? '<a style="float: right;" href="' . get_permalink( get_previous_post()->ID ) . '">' . $next_name . '</a>' : ''; $posts = '<div class="wp-post-navigation-next">'.$next_link.$prev_link.'</div>'; return $content . $posts; } else { return $content; } }
Let us know how it goes.
November 10, 2015 at 10:16 am #659752Thanks, but I have not been able to test. In two or three days I will. Thank you
🙂
November 10, 2015 at 11:29 am #659844You’re most welcome 🙂
Let us know how it goes!
November 23, 2015 at 5:09 am #675779Thanks, WORKS
🙂November 23, 2015 at 5:16 am #675783Glad it worked 🙂
If you need anything else, please let us know.
-
AuthorPosts