-
AuthorPosts
-
April 5, 2017 at 11:58 am #772435
Hello,
I would like to show the previous/next buttons (on the left/right edges of the screen) only on single posts of a specific category (News).
I tried the following but it does not work:if (!function_exists('swap_single_post_next_and_previous_mod')) { add_filter( 'avia_post_nav_entries', 'swap_single_post_next_and_previous_mod', 10, 2); /** * Swap the next and previous navigation on single posts * * @param array $entries * @param array $settings * * @return array */ function swap_single_post_next_and_previous_mod( $entries, $settings ) { if ( ! isset( $entries['prev'], $entries['next'] ) || $settings['taxonomy'] = 'News') { return $entries; } $temp_prev = $entries['prev']; $entries['prev'] = $entries['next']; $entries['next'] = $temp_prev; return $entries; } }
Also I would like the buttons to show up a little below there current centered postion.
Many thanks in advance,
NeverlandsApril 6, 2017 at 10:47 am #773081Hey Neverlands,
I think you should be able to achieve that using CSS instead, could you post a link to post belonging to that category so that we can have a closer look?
Best regards,
RikardApril 6, 2017 at 12:36 pm #773144Hello Rikard,
thanks for your reply!
Here are the links..Best regards,
NeverlandsApril 10, 2017 at 5:45 am #775256Hi,
Thanks for that, I’m not sure why the buttons are not showing. Could you please provide us with a temporary admin login so that we can take a closer look? You can post the details in the Private Content section of your reply.
Best regards,
RikardApril 10, 2017 at 8:33 pm #775623Hi Rikard,
thanks for your reply.
Here are the credentials.Best regards,
Neverlands- This reply was modified 7 years, 8 months ago by John Torvik.
April 10, 2017 at 8:44 pm #775628Hi,
Please, I`ve tried to access your dashboard and they are wrong, may you check it?
Best regards,
John TorvikApril 11, 2017 at 12:48 pm #775975Hello john,
could you please try it again now?
Best regards,
NeverlandsApril 12, 2017 at 4:58 am #776427Hi,
Thanks for that but it seems like the account is not active, could you activate it please?
Best regards,
RikardApril 12, 2017 at 11:38 am #776583Hello Rikard,
the account is now activated.Many thanks,
NeverlandsApril 13, 2017 at 6:43 am #777037Hi,
Thanks for that, I got in now. I can see that you have used the Blog Posts elements inside of a blog post, why have you done it that way? Why not use a page instead?
Best regards,
RikardApril 13, 2017 at 12:35 pm #777213HII Rikard,
I used a page because I need the URL path to be /druckerei-wien/news.
I don’t know how to manage that with a page. Do you have a tip how I can get this path with a page?In the devsystem I changed the post in a page now.
With this code in funtions.php the navigation works fine:/* Set Avia Post Nav to only navigate between posts of the same category */ add_filter('avia_post_nav_settings', 'avia_post_nav_settings_mod'); function avia_post_nav_settings_mod($settings) { $settings['is_fullwidth'] = false; $settings['same_category'] = true; return $settings; }
I have two other questions:
1. Is it possible to reverse the prev/next buttons – so that the previous button is on the right side?
2. Navigating through the main menu always changes the colour of the .avia-menu-textExample for the “Über Uns” menu:
.yellow-top:hover > a > .avia-menu-text { color: orange; } li[id*='menu-item'].category-yellow.active-parent-item > a > .avia-menu-text, li[id*='menu-item'].yellow-top.current-menu-item > a > .avia-menu-text { color: orange; } li[id*='menu-item'] .category-yellow > a { background-color: rgba(255, 165, 0, 0.85) !important; border-color: transparent !important; } li[id*='menu-item'] .category-yellow > a:hover { background-color: rgba(247, 184, 49, 0.85) !important; } #mobile-advanced .yellow-top > a > .avia-menu-text, #mobile-advanced li .category-yellow > a, #mobile-advanced li .category-yellow > a:hover { color: orange; }
How can I manage to change the colour of “Über Uns” when navigating through the News posts which have the path/URL /druckfrische-news/..?
Many thanks and
best regards,
NeverlandsApril 13, 2017 at 1:18 pm #777242PS
If I keep /druckerei-wien/news as a post with the function filter mentioned above the navigation buttons are displayed as they should but on each post that is not fullwidth. I only need the navigation buttons on the news posts within the category “druckfrische-news” .
You can see it on the livesystem.With these settings I only needed a function filter that sets all posts that are not in the category “druckfrische-news” to css:
#top .avia-post-nav { display: none; }
Unfortunately I am not sure how to set up that filter.April 14, 2017 at 5:29 am #777628Hi,
Thanks for the feedback, so your initial problem is solved? You can get the URL you want by assigning the news page as a child to your druckerei-wien page. Please try to stick to one problem per thread, as they become impossible for us to follow otherwise.
Best regards,
RikardApril 14, 2017 at 4:47 pm #777885Hello Rikard,
yes, you can mark this thread as solved :)
Many thanks!
Concerning the changing of the colour of the .avia-menu-text I will open a new one.Best regards,
NeverlandsApril 16, 2017 at 1:25 am #778321 -
AuthorPosts
- The topic ‘previous/next buttons’ is closed to new replies.