• Resolved pixelauflauf

    (@pixelauflauf)


    Hello,
    thank you very much for your well designed and progammed free themes.
    My question relate to the single post navigation.
    When the user jump from a choosen category view to a single post, the single post navigation lost the category and is now relate to the timeline of the posts.

    I already learned, that the function next_post_link and previous_post_link use the $in_same_cat argument, to solve this which. But i can´t find the funktion.

    I take a look to the inc/template-tags.php file, but my knowledge about php and wp funktions is too small to solve this.

    Would you kindly send me some tips, i can try out in my child theme?

    VIelen Dank from Hannover
    Peter Schulz
    pixelauflauf.de

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author Shaped Pixels

    (@shaped-pixels)

    Hi Peter…sorry for late reply as I am just now starting my day here. Also, thank you for your comment about Aberration Lite.

    If I understand you correctly, you want to modify the single post navigation, but want to know which files?

    The file where the nav is coded is the /inc/template-tags.php file and begins around line 241 to 257 and starts with this:

    /**
     * Single Post previous or next navigation.
     */

    You will need to create a new function, with your own unique name for it and then use that name in your override for another file that loads the single post view:

    /template-parts/content-single.php

    The line that calls for the function (current one) is:

     		<?php // For post navigation with next and previous
    			if( esc_attr(get_theme_mod( 'show_next_prev', 1 ) ) ) {
    			aberration_lite_post_pagination();	
    			}
    		?>  

    Make note of the “aberration_lite_post_pagination();” line. You would copy this file into yoru child theme and change that to your own function name. Make sure you copy and paste this file in your child theme in the same path as the parent theme….in a folder named “template-parts”.

    Theme Author Shaped Pixels

    (@shaped-pixels)

    By the way, I see you are making some changes to the theme, but one thing I noticed is that your header area is slightly off-center. Add this CSS

    .site-header {
        width: 100%;
    }

    The default code was:

    .site-header {
        position: absolute;
        width: 96.3%;
        z-index: 1000;
    }

    As a side note….nicely done on the site with the theme; looks great!

    • This reply was modified 9 years, 3 months ago by Shaped Pixels.
    Thread Starter pixelauflauf

    (@pixelauflauf)

    Hi,
    there is no neccesary for sorry. You are so fast, I didnt expect your immediately answer . Thanks.
    During my next free days, i will try to puzzel a single post navigation in my child theme based on these tips.

    I build a child theme, but i didnt change the css, so i have no explanation about the off-center header area. I must admit, id didnt see it.

    Again, thanks a lot for your work arround these free themes.
    Peter

    Theme Author Shaped Pixels

    (@shaped-pixels)

    You are very welcome. A reminder that any custom css you do, you can add that to the child theme’s own style.css file.

    Is it safe to set this topic as “Resolved” ?

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

The topic ‘Single Post Navigation inside a Catagory’ is closed to new replies.