Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #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,
    Neverlands

    #773081

    Hey 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,
    Rikard

    #773144

    Hello Rikard,
    thanks for your reply!
    Here are the links..

    Best regards,
    Neverlands

    #775256

    Hi,

    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,
    Rikard

    #775623

    Hi Rikard,

    thanks for your reply.
    Here are the credentials.

    Best regards,
    Neverlands

    • This reply was modified 7 years, 7 months ago by John Torvik.
    #775628

    Hi,

    Please, I`ve tried to access your dashboard and they are wrong, may you check it?

    Best regards,
    John Torvik

    #775975

    Hello john,

    could you please try it again now?

    Best regards,
    Neverlands

    #776427

    Hi,

    Thanks for that but it seems like the account is not active, could you activate it please?

    Best regards,
    Rikard

    #776583

    Hello Rikard,
    the account is now activated.

    Many thanks,
    Neverlands

    #777037

    Hi,

    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,
    Rikard

    #777213

    HII 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-text

    Example 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,
    Neverlands

    #777242

    PS
    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.

    #777628

    Hi,

    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,
    Rikard

    #777885

    Hello 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,
    Neverlands

    #778321

    Hi,
    Glad Rikard was able to help, we will close this now. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘previous/next buttons’ is closed to new replies.