- This topic has 7 replies, 2 voices, and was last updated 1 year, 1 month ago by
David.
-
AuthorPosts
-
March 4, 2020 at 8:13 am #1184930
Amit
I want to use Next post and Previous post written in navigation instead of arrows like this:
https://drive.google.com/file/d/1U7-Ee5UYlvi-7y7y1WV6Gd_Y77dNiWpH/view?usp=drivesdkHow to do that??
March 4, 2020 at 5:05 pm #1185324David
StaffCustomer SupportHi there,
can you provide an example of how you would like them to look ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 4, 2020 at 7:24 pm #1185392Amit
Here is the example:
https://drive.google.com/file/d/1USfCutL51ICgYyH3PHAq4X7TM1_MzRB-/view?usp=drivesdk
March 4, 2020 at 7:25 pm #1185393Amit
Here is the example:
https://drive.google.com/file/d/1USfCutL51ICgYyH3PHAq4X7TM1_MzRB-/view?usp=drivesdk
March 5, 2020 at 4:58 am #1185701Amit
Hey David, I have given the example.
Would you tell me how to do that???
March 5, 2020 at 5:31 am #1185722David
StaffCustomer SupportAdd this PHP Snippet:
add_filter( 'generate_post_navigation_args', function( $args ) { $args['next_format'] = '<div class="nav-next"><span class="post-nav-label">Next article</span><span class="next" title="' . esc_attr__( 'Next', 'generatepress' ) . '">%link</span></div>'; $args['previous_format'] = '<div class="nav-previous"><span class="post-nav-label">Previous article</span><span class="prev" title="' . esc_attr__( 'Previous', 'generatepress' ) . '">%link</span></div>'; return $args; } );
And then this CSS:
#nav-below { display: flex; justify-content: space-between; } #nav-below div { flex: 1 0 50%; position: relative; margin-top: 1em; margin-bottom: 1em; } #nav-below div a:before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; } #nav-below div span { display: block; } .post-nav-label { font-size: 14px; opacity: 0.5; margin-bottom: 0.5em; } .nav-next { text-align: right; } @media (max-width: 768px) { #nav-below { flex-direction: column; } #nav-below div { flex: 1 0 100%; } .nav-next { text-align: left; } }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 5, 2020 at 5:43 am #1185735Amit
Where will I add the PHP snippet??
I mean functions.php or header.php or else ???
March 5, 2020 at 5:54 am #1185742David
StaffCustomer SupportThis article explains:
https://docs.generatepress.com/article/adding-php/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.