Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Waningett

    (@waningett)

    I do feel a bit stupid now, that the answer actually was so simple, but I guess sometimes it takes an extra set of eyes to se what is going on.
    I thank you ??

    Thread Starter Waningett

    (@waningett)

    Hej again!
    Ok, I’ve posted the different template-parts that make up my index page into this paste bin: https://pastebin.com/848VEHgM
    I really appreciate your help!

    Thread Starter Waningett

    (@waningett)

    Hej and thanks again for your response, but… it still doesn’t do the trick.
    Would it help if I give the code for the waningett_content_nav() function?

    if ( ! function_exists( 'waningett_content_nav' ) ):
    function waningett_content_nav( $nav_id ) {
        global $wp_query, $post;
        if ( is_single() ) {
            $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
            $next = get_adjacent_post( false, '', false );
    
            if ( ! $next && ! $previous )
                return;
        }
    
        if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) )
            return;
    
        $nav_class = 'site-navigation paging-navigation';
        if ( is_single() )
            $nav_class = 'site-navigation post-navigation';
        ?>
        <nav role="navigation" id="<?php echo $nav_id; ?>" class="<?php echo $nav_class; ?>">
            <h1 class="assistive-text"><?php _e( 'Post navigation', 'waningett' ); ?></h1>
    
        <?php if ( is_single() ) : ?>
    
            <?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'waningett' ) . '</span> %title' ); ?>
            <?php next_post_link( '<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'waningett' ) . '</span>' ); ?>
    
        <?php elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) :  ?>
    
            <?php if ( get_next_posts_link() ) : ?>
            <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> ?ldre', 'waningett' ) ); ?></div>
            <?php endif; ?>
    
            <?php if ( get_previous_posts_link() ) : ?>
            <div class="nav-next"><?php previous_posts_link( __( 'Nyare <span class="meta-nav">&rarr;</span>', 'waningett' ) ); ?></div>
            <?php endif; ?>
    
        <?php endif; ?>
    
        </nav>
        <?php
    }
    endif;

    and maybe you can check the site itself, https://www.waningett.se.
    Mind you, the navigation works as a charm for the single pages, and I would like to keep it that way, but it’s the index page that is the problem..
    Thank you so much for your help! I am fist and far most a designer and not a programer, which becomes painfully clear in this situation ??

    Thread Starter Waningett

    (@waningett)

    Thanks vtxyzzy, it almost works ??

    The thing is that the navigation is back and it works on the posts, that is the good news, but the bad new is that it also affects the static part of the site… It now shows the 404-template part in the main area where the static text used to be. Any tips on how to solve this problem?
    It’s so frustrating that some things don’t work the same offline as they do online..

    Thread Starter Waningett

    (@waningett)

    Super bedankt!
    It works great ??

Viewing 5 replies - 1 through 5 (of 5 total)