Remove page navigation from archives

Community Forums Forums General Discussion Remove page navigation from archives

This topic is: not resolved

This topic contains 7 replies, has 3 voices, and was last updated by  braddalton 1 year, 6 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #34797

    virginie
    Participant
    Post count: 7

    Hi,

    Where can I find the function to remove page navigation from archives?

    I would like to install wp-pagenavi that seems to work with q-translate plugin  (see  topic http://www.studiopress.com/forums/topic/previous-page-qtranslate-back-to-default-language/ )

    thank you

     

    #34874

    David Chu
    Participant
    Post count: 1374

    Allo Virginie,
    Here’s a function that will remove the Primary Navigation menu for archives. This would go into your functions.php.

    [php]
    add_action( ‘genesis_before’, ‘dc_pull_out_menu’ );
    function dc_pull_out_menu () {
    if ( is_archive() ) {
    remove_action( ‘genesis_after_header’, ‘genesis_do_nav’ );
    }
    }
    [/php]

    “is_archive” refers to a number of things, though, so you can check here to see.
    Ciao,
    Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    #34986

    virginie
    Participant
    Post count: 7

    Thank you Dave but I’m looking for the Previous/Next page navigation at the bottom.

    #35002

    David Chu
    Participant
    Post count: 1374

    Virginie,
    Sorry, I misunderstood. I think this might help you. Same idea, this would go in functions.php. This should work unless the theme is heavily customized.

    [php]
    remove_action(‘genesis_after_endwhile’, ‘genesis_posts_nav’);
    [/php]

    Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    #35869

    virginie
    Participant
    Post count: 7

    great thanks.

    Now i’m looking for the function or hook to replace the genesis_posts_nav by

    <?php wp_pagenavi(); ?> or
    <?php if(function_exists(‘wp_pagenavi’)) { wp_pagenavi(); } ?>
    not sure i’m doing right.

    #35894

    braddalton
    Participant
    Post count: 10351

    http://genesistutorials.com/visual-hook-guide/ There’s a few you can choose from.

    Here’s some sample code you can modify which i tested on single posts:

    You can easily change the conditional tag. http://codex.wordpress.org/Conditional_Tags


    #36068

    virginie
    Participant
    Post count: 7

    Great! Thank you Brad.

    I modified the code with  is_archive  and  genesis_after_endwhile

    the code works perfectly but didn’t fix my first archive page language problem :(

    Are you aware of the problem between qtranslate and genesis_post_nav? (first page back to default language even if the link on source code show the right one)

    thank you again

    #36079

    braddalton
    Participant
    Post count: 10351

    No sorry but you could use another translate plugin.


Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.