Jon Lynch

Member

Forum Replies Created

  • By default WordPress consists of posts (designed for chronological entries) and pages (static, hierarchical) content. It would have you navigate from one post to the next, in chronological order, independent of what category they are in. Pages do not get navigation by default.

    It is possible to get one to behave like another (with considerable hacking) but even custom post types have to be based on either a hierarchy (like pages) or chronology (like posts). On my site the incidents are a custom post type based on posts.

    I think most of your content should be page based since the time it is written is not what you want to sort it by, Using the <!–nextpage–> gives you a multipage page. I am sure you would be able to find a plugin to style or add navigation.

    In reply to: Showing Off Wasdale Mountain Rescue

    #16712

    Syahir, thank you very much for the feedback, and of course the excellent theme, both ideas now implemented.

    Charlie, Yes I just created another menu in the custom menus and then set it to the footer menu. Nothing too complicated.

    Ken, thank you !

    Have you tried <!–nextpage–>, just write a very long page (not post) and break in into pages. Have a look at http://www.wmrt.org.uk/previous-years-rescues/rescues-in-2010/1/ where I just used to to split off the first few months. Read more at http://codex.wordpress.org/Styling_Page-Links

    When we want to apply css to one element we give that element an id, there is a line in your functions.php with <div id=”my-post-nav>. When applying css to multiple elements we use a class so we need to change that div to <div class=”my-post-nav”>.

    But having thought about it if we use a class we have to style the two sets of links (one at top and one at bottom) the same. So despite what I said previously I would now, rather than use exactly the same function, and call it twice, I would add a duplicate with a couple of different names, that way you can style each set of links seperately:

    Try adding this to your functions.php

    <?php
    // attaches the function my_post_nav_top to the hook
    add_action ('graphene_before_content', 'my_post_nav_top');

    // our function
    function my_post_nav_top(){

    // 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-top"> <!-- div to contain your links -->
    <?php previous_post_link_plus( array(
    'order_by' => 'menu_order',
    'loop' => true,
    'max_length' => 0,
    'tooltip' => 'Previous page',
    'in_same_cat' => true,
    'ex_cats' => '12'
    ) );?> |
    <?php next_post_link_plus( array(
    'order_by' => 'menu_order',
    'loop' => true,
    'max_length' => 0,
    'tooltip' => 'Next page',
    'in_same_cat' => true,
    'ex_cats' => '12'
    ) );?>
    </div>
    <?php endif; ?>
    <?php } ?>

    You can use #my-post-nav-top {... } to style the top links.

    As for the images I think you can include the what to display in the parameters to sent to post link plus so it doesn’t have to be done in css. adding something like this to the list of parameters sent to post_link_plus, add this line before the orderby line and change the myimage.png to the name of your image.

    'format' => '<img src="myimage.png" /> %link',

    Glad you are nearly there!

    I’m glad its working! Using what we have put in functions.php they are now in a div with id of my-post-nav so the css is not working. Try:

    #my-post-nav {
    clear: both;
    border-top: 1px solid #E3E3E3;
    padding-top: 10px;
    }

    .entry-footer {
    display: none
    }

    That should get them more or less where you want them.

    If you want them at the top as well you need to add another line to functions.php

    add_action('graphene_before_content', 'my_post_nav');

    Since this will put two of these on the page you should change id to class for the div.

    In reply to: Resizing Thumbnails in Slider

    #16855

    I suggets you try adding:

    add_filter('graphene_slider_image_size', 'booksize-thumb');

    To your functions.php. Note I have not tested this.

    Jon

    Yes to all of the above!

    if you are looking to have the links at the bottom try one of

    graphene_after_post_content
    graphene_post_footer
    graphene_loop_footer

    Instead of graphene_post_nav

    Sorry I had taken the code from my functions.php, which probably confused you.

    There are a variety of options of how to complete this:

    – Edit loop.php, Advantage – simple, Disadvantage – overwritten when Graphen is updated

    – Copy loop.php, then edit – Advantage keep changes when upgrading, Disadvantage never get the benefits of new features in upgrades

    – Use Action Hooks, Advantage can upgrade and get benefits, easy to move to another hook, drawbacks more complex to implement.

    <?php
    // attaches the function my_post_nav to the hook graphene_post_nav
    add_action ('graphene_post_nav', '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' => true,
    'max_length' => 0,
    'tooltip' => 'Previous page',
    'in_same_cat' => true,
    'ex_cats' => '12'
    ) );?> |
    <?php next_post_link_plus( array(
    'order_by' => 'menu_order',
    'loop' => true,
    'max_length' => 0,
    'tooltip' => 'Next page',
    'in_same_cat' => true,
    'ex_cats' => '12'
    ) );?>
    </div>
    <?php endif; ?>
    <?php } ?>

    If you place the whole code block into your functions.php you should see your links underneath the default ones.

    If this is working for you then you can experiment with replacing graphene_post_nav with the names of other hooks. A complete list is at http://wiki.khairul-syahir.com/graphene-theme/wiki/Actions_Reference . I would recommend trying graphene_before_post or graphene_before_post_content.

    If all this works you just need to hide the existing links using css and style the new links.

    Hope this helps

    Jon

    Ok here goes, my post on the other thread suggested copying loop.php, the easiest way. I actually use action hooks. To add a new navigation section and then use css to hide the default one.

    The php code needs to be added to functions.php (create one in your child theme directory if you don’t have one already.

    <?php
    add_action ('graphene_post_nav', 'my_post_nav');
    function my_post_nav(){ ?>
    <p id="previous-new"><?php previous_post_link('&laquo; %link', '%title', TRUE); ?></p>
    <p id="next-post-new"><?php next_post_link('%link &raquo;', '%title', TRUE); ?></p>
    <? }

    You now need to hide the default links using CSS and style the two new ones using:

    #previous-new, #next-post-new { copy css from default links here }
    #previous, #next-post {display: none;}

    You could of course add your ambrosite code to the function I have put above.

    Hope this helps

    Jon

Viewing 10 posts - 31 through 40 (of 45 total)