Page navigation

  • raindance

    #1912

    I see this line in my loop-single file:

    <?php wp_link_pages(array(‘before’ => __(‘<div class=”link-pages”><p>Pages: ‘,’graphene’), ‘after’ => ‘</p></div>’, ‘next_or_number’ => ‘number’)); ?>

    But I don’t see any page navigation other than what I’ve now installed being the Ambrosite Next/Previous.

    What is this line for and why is it not showing any page navigation on my pages? Is there a setting somewhere I’m missing to activate it?

    Thanks

    raindance

    #17802

    I’ve got this for my loop-single.php code:

    <?php do_action('graphene_post_meta'); ?>
    </div>
    <?php endif; ?>
    <div id="ambrosepagenav">
    <?php previous_page_link_plus( array(
    'order_by' => 'post_title',
    'loop' => true,
    'max_length' => 30,
    'tooltip' => 'Previous page',
    'in_same_parent' => true,
    'ex_pages' => '5, 12'
    ) );?> |
    <?php next_page_link_plus( array(
    'order_by' => 'post_title',
    'loop' => true,
    'max_length' => 30,
    'tooltip' => 'Next page',
    'in_same_parent' => true,
    'ex_pages' => '5, 12'
    ) );?>
    </div>
    <?php /* Post content */ ?>
    <div class="entry-content clearfix">
    <?php do_action('graphene_before_post_content'); ?>

    <?php if ((is_home() && !$graphene_settings['posts_show_excerpt']) || is_singular() || (!is_singular() && !is_home() && $graphene_settings['archive_full_content'])) : ?>

    <?php /* Social sharing buttons at top of post */ ?>
    <?php if (stripos($graphene_settings['addthis_location'], 'top') !== false) {graphene_addthis(get_the_ID());} ?>

    <?php /* The full content */ ?>

    <?php the_content('<span class="block-button">'.__('Read the rest of this entry &raquo;','graphene').'</span>'); ?>
    <?php else : ?>
    <?php /* The post thumbnail */
    if (has_post_thumbnail(get_the_ID())) { ?>
    <div class="excerpt-thumb">
    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(esc_attr__('Permalink to %s', 'graphene'), the_title_attribute('echo=0')); ?>">
    <?php the_post_thumbnail(apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail')); ?>
    </a>
    </div>
    <?php
    } else {
    echo graphene_get_post_image(get_the_ID(), apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail'), 'excerpt');
    }
    ?>

    <?php /* The excerpt */ ?>
    <?php the_excerpt(); ?>
    <?php endif; ?>
    <div id="ambrosepagenav">
    <?php previous_page_link_plus( array(
    'order_by' => 'menu_order',
    'loop' => false,
    'max_length' => 0,
    'tooltip' => 'Previous page',
    'in_same_parent' => true,
    ) );?> |
    <?php next_page_link_plus( array(
    'order_by' => 'menu_order',
    'loop' => false,
    'max_length' => 0,
    'tooltip' => 'Next page',
    'in_same_parent' => true,
    ) );?>
    </div>
    <?php wp_link_pages(array('before' => __('<div class="link-pages"><p><strong>Pages:</strong> ','graphene'), 'after' => '</p></div>', 'next_or_number' => 'number')); ?>

    <?php do_action('graphene_after_post_content'); ?>

    </div>

    And the bottom set of nav links are showing up below the share this icons. I’d prefer the links be above them, but everywhere I try to paste that code for the links in between where it is now does nothing.

    Any idea how in the code above to get it above the share this icons?

    Also, I’d rather do it as a hook but don’t know if that’s an option?

    And, these links are showing up on posts as well as pages…but they should only show up on pages, not posts.

    The code I have in my child functions file is

    <?php
    function graphene_slider_post_types(){
    return array('post', 'page');
    }
    add_filter( 'graphene_slider_post_type', 'graphene_slider_post_types' );
    // attaches the function my_post_nav to the hook graphene_post_nav
    add_action ('graphene_after_post_content', 'my_post_nav');
    // our function

    function my_post_nav(){
    // this will allow us to use other hooks but still only show on single posts
    if ( is_single() && ! is_page() ) : ?>
    <div id="my-post-nav"> <!-- div to contain your links -->
    <?php previous_post_link_plus( array(
    'order_by' => 'menu_order',
    'loop' => false,
    'max_length' => 0,
    'tooltip' => 'Previous page',
    'in_same_cat' => true,
    'ex_cats' => '12'
    ) );?> |
    <?php next_post_link_plus( array(
    'order_by' => 'menu_order',
    'loop' => false,
    'max_length' => 0,
    'tooltip' => 'Next page',
    'in_same_cat' => true,
    'ex_cats' => '12'
    ) );?>
    </div>
    <?php endif;
    }

    /******
    * these next two remove the graphene breadcrumb and then add one
    * which does not appear on the home page
    *****/

    // has to be called after the action is added
    add_action ('after_setup_theme', 'wmrt_remove_graphene_bc');

    function wmrt_remove_graphene_bc() {
    remove_action ('graphene_top_content', 'graphene_breadcrumb_navxt');
    }
    add_action('graphene_top_content', 'wmrt_breadcrumb_navxt');

    function wmrt_breadcrumb_navxt () {
    //by calling this at this point is_home() works!
    if ((function_exists('bcn_display')) && (!(is_front_page()))) {
    echo '<div class="breadcrumb">';
    bcn_display();
    echo '</div>';
    }
    }

    function graphene_filter_gettext( $translated, $original, $domain ) {
    $strings = array(
    'View full post' => 'Read More',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );

    Any help appreciated. I’m stuck.

    raindance

    #17803

    On this page is more or less how I want it

    http://juicytravels.com/the-ten-best-first-class-airline-experiences-today/

    But I’d prefer the first/previous/next links above the social icons and I’d like the social icons in their own div I can move down to the bottom.

    But on this post

    http://juicytravels.com/the-ten-best-airline-experiences-now-3/

    See the problem? I don’t want to top links or the bottom first previous next links to show up there. I guess they are because I put them on the loop-single.php page…but I want those to only show up on pages not posts.

    Any help? I’m really stuck.

    raindance

    #17804

    I took them out of the loop-single.php file so now they aren’t on anything.

    Can anyone help me figure out how to use a hook for the Ambrosite plug in?

    Anonymous

    #17805

    Check this thread, and see my last comment. It may point you in the right direction with using hooks.

    https://forum.graphene-theme.com/graphene-support/styling-header-widget

    raindance

    #17806

    Yup that’s exactly what I want to do but not sure how to code it because it seems there is no hook for page nav? Or would I just add an action hook for “do action” then paste in the plug in code?

    <div id="ambrosepagenav">
    <?php previous_page_link_plus( array(
    'order_by' => 'menu_order',
    'loop' => false,
    'max_length' => 0,
    'tooltip' => 'Previous page',
    'in_same_parent' => true,
    ) );?> |
    <?php next_page_link_plus( array(
    'order_by' => 'menu_order',
    'loop' => false,
    'max_length' => 0,
    'tooltip' => 'Next page',
    'in_same_parent' => true,
    ) );?>
    </div>

    raindance

    #17807

    This is what’s in my functions file now for the POST plug in links and I have that working perfectly for posts. But I want now to do the same thing for PAGES.

    My current code on functions.php looks like this:

    <?php
    function graphene_slider_post_types(){
    return array('post', 'page');
    }
    add_filter( 'graphene_slider_post_type', 'graphene_slider_post_types' );
    // attaches the function my_post_nav to the hook graphene_post_nav
    add_action ('graphene_after_post_content', 'my_post_nav');
    // our function

    function my_post_nav(){
    // this will allow us to use other hooks but still only show on single posts
    if ( is_single() && ! is_page() ) : ?>
    <div id="my-post-nav"> <!-- div to contain your links -->
    <?php previous_post_link_plus( array(
    'order_by' => 'menu_order',
    'loop' => false,
    'max_length' => 0,
    'tooltip' => 'Previous page',
    'in_same_cat' => true,
    'ex_cats' => '12'
    ) );?> |
    <?php next_post_link_plus( array(
    'order_by' => 'menu_order',
    'loop' => false,
    'max_length' => 0,
    'tooltip' => 'Next page',
    'in_same_cat' => true,
    'ex_cats' => '12'
    ) );?>
    </div>
    <?php endif;
    }

    So…I’m not sure how to make it work for pages instead of posts….we do know that the code that makes the links for pages is as I posted above…but I’m not sure how to make it attach with a hook.

    Thanks..by the way nice progress on your site…it’s looking great!

    raindance

    #17808

    Wow this one looks exactly like what I was looking for…has anyone tried it?

    http://codecanyon.net/item/easy-pagination-for-wordpress/224486

    It’s $17. Seems like it does exactly what I want something to do.

    Anyone have any experience with it?

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

You must be logged in to reply to this topic.

Do NOT follow this link or you will be banned from the site!