- This topic has 6 replies, 2 voices, and was last updated 3 years, 11 months ago by
Tom.
-
AuthorPosts
-
April 16, 2019 at 7:07 am #870584
Callista
Hi there!
Sorry for opening so many topics lately. I’ve tried to fix this on my own but I’m not quite able to do what I want.I want the post navigation to be like the following:
Previous Post: Next Post:
< Thumbnail image Thumbnail image >
Post title Post titleIf possible, I’d like the arrow itself to be a button I could hover over and click, looking like the “back to top” button. The Previous Post/Next Post labels can be hyperlinks or not, I don’t really care.
I’ve followed the instructions in this post, and that works great, but I changed the code to make the post titles below the thumbnail images, but I’m having a problem with the arrows. For example, I modified the code thus:
previous_post_link( '<div class="nav-previous"><p class="prev-label">Previous Article:</p><span class="prev" title="' . __('Previous','generatepress') . '">%link</span></div>', '<span class="prev-thumbnail">' . $prevThumbnail . '</span>' . '<p class="prev-title">' . '%title' . '</p>', $category_specific ); next_post_link( '<div class="nav-next"><p class="next-label">Next Article:</p><span class="next" title="' . __('Next','generatepress') . '">%link</span></div>', '<span class="next-thumbnail">' .$nextThumbnail . '</span>' . '<p class="next-title">' . '%title' . '</p>', $category_specific );
And the result is this:
Previous Post: Next Post:
< Thumbnail image Thumbnail image
Post title Post title
>No matter what CSS I try, the right arrow refuses to budge. Also, I’m nervous about messing with margins in CSS because it might make it look weird on mobile. Also, although this sort of accomplishes what I want, I can’t style the arrows or make them clickable.
What else can I try?
Thanks so much!
Have a great day!
CallistaGeneratePress 2.2.2GP Premium 1.7.8April 16, 2019 at 7:14 am #870591Callista
Oops, looks like I need to show an image. Here’s what it looks like. Note the hanging arrow on the right side.
http://www.callistarakhmatov.com/wp-content/uploads/2019-04-16.png
Thanks!
April 16, 2019 at 4:20 pm #870989Tom
Lead DeveloperLead DeveloperHi there,
Looks like you’re close! Any chance you can send us login details so we can bypass the coming soon page?: https://generatepress.com/contact
Let me know ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentApril 16, 2019 at 4:34 pm #871000Callista
Of course! Sending the info over now.
April 17, 2019 at 9:33 am #871771Tom
Lead DeveloperLead DeveloperGive this CSS a try, and be sure to remove the two blocks of custom CSS I’ve adjusted:
.post-navigation .nav-next .next a:after { font-family: GeneratePress; text-decoration: inherit; position: relative; margin-left: .6em; width: 13px; text-align: center; display: inline-block; content: "\f105"; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; font-style: normal; font-variant: normal; text-rendering: auto; line-height: 1; speak: none; font-size: 2em; color: #000; position: absolute; right: 0; top: calc(50% - 30px); } .post-navigation .nav-previous .prev a:before { font-family: GeneratePress; text-decoration: inherit; position: relative; margin-left: .6em; width: 13px; text-align: center; display: inline-block; content: "\f104"; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; font-style: normal; font-variant: normal; text-rendering: auto; line-height: 1; speak: none; font-size: 2em; color: #000; position: absolute; left: 0; top: calc(50% - 30px); } .nav-next { position: relative; padding-right: 20px; } .nav-previous { position: relative; padding-left: 20px; } .nav-previous .prev:before { display: none; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentApril 17, 2019 at 2:22 pm #872006Callista
Hi Tom,
That’s perfect!! The only slight tweak I have is in the first 2 blocks, I removed “position:relative;” because later you have “position:absolute;” and I didn’t want them to conflict.
It’s exactly what I was looking for. Thank you sooooo much!!
Best,
CallistaApril 17, 2019 at 3:36 pm #872055Tom
Lead DeveloperLead DeveloperAwesome! You’re welcome ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.