Archived topic
Need some help with blog (Previous) – (Next) Navigation
2 replies · Started by Casper on October 10, 2017
I created a a custom post type with pods and added the following code in the single page template to display the navigation
<div class="post-pag-wrap">
<div class="post-pag-container prev">
<?php previous_post_link('
<span>Previous</span>
<h4>%link</h4>
', '%title', false);
?>
</div>
<div class="post-pag-container next">
<?php next_post_link('
<span>Next</span>
<h4>%link</h4>
', '%title', false);
?>
</div>
</div>
And added the following CSS to the Childtheme/Customizer/Additional CSS
.post-pag-wrap {
padding: 5px 0px;
box-sizing: border-box;
border-top: 1px solid #bbbbbb;
border-bottom: 1px solid #bbbbbb;
width: 100%;
max-width: 600px;
margin: 10px auto 25px;
}
.post-pag-container {
width: 49%;
padding: 0px 5px;
box-sizing: border-box;
display: inline-block;
overflow-wrap: break-word;
word-wrap: break-word;
vertical-align: top;
min-height: 50px;
}
.post-pag-container h4 {
font-size: 16px;
font-family: ‘Open Sans’, sans-serif;
font-weight: bold;
padding: 0px;
margin: auto;
margin-top: 5px;
margin-bottom: 0px;
}
.post-pag-container.prev {
text-align: left;
border-right: 1px solid #bbbbbb;
margin-right: -1px;
}
.post-pag-container.next {
text-align: right;
margin-left: -2px;
}
.post-pag-container.prev h4 {
text-align: left;
}
.post-pag-container.next h4 {
text-align: right;
}
My questions
How can I add this navigation to my normal Blog Page and post pages?
Where do I need to add the code?
How can I make it to show all Blog related pages in the same way?
Website is still under development
But you can see it here http://www.site1.helpme.net.za
Bottom of home page can take you to the custom post type "Quote of the day"
Thanks
Casper
Hi there,
Where is this code currently added? In the content?
I think you can try using the after footer content hook:
http://demo.generatepress.com/hook-locations/
https://docs.generatepress.com/article/hooks-overview/
With conditional tags to make it show on desired page: https://codex.wordpress.org/Conditional_Tags
Let me know if this helps.
Hi..
The code is part of the single page template that I created with Pods..
The CSS is added to the Child theme through the wordpress customizer
Thanks...
Will read up on the links provided, as soon as I have enough time....