previous post / next post

Community Forums Forums Design Tips and Tricks previous post / next post

This topic is: resolved

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

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #18484

    verymom
    Participant
    Post count: 17

    I am running Prose, and have the older / newer links at the bottom of the blog page, but would like to add the ‘previous post / next post’ links to individual post pages – I’d like to use the following code, which will turn those links into post titles.  In previous themes, I could just add this code to the single.php page – but I’m still utterly lost in the Genesis framework.  All the templates I’m used to are missing, buried, or hidden in function-type files.  So, help.  Where would something like this go?

    <code>

    <div class=”navigation”>
    <div class=”alignleft”>
    <?php previous_post(‘&laquo; &laquo; %’,
    ‘Toward The Past: ‘, ‘yes’); ?>
    </div>
    <div class=”alignright”>
    <?php next_post(‘% &raquo; &raquo; ‘,
    ‘Toward The Future: ‘, ‘yes’); ?></code>

     

    #18496

    wendycholbi
    Participant
    Post count: 120

    I suggest checking out these Genesis code snippets for post navigation — the “next page” and “previous page” snippets may be what you’re looking for. You can customize the link text as you wish.

    The instructions on those snippets say to add them to your functions.php file, but Prose works differently: Instead of modifying the functions.php file, you should place custom functions (PHP snippets) in Genesis –> Custom Code –> Custom Functions.

    And…welcome to Genesis! Yes, there is a learning curve, as there is with anything new — but the end results, and the power and flexibility of the framework, are so worth it. The Genesis Tutorials and Code Snippets are great places to start digging in.


    I love WordPress, Genesis, and the Prose child theme (my complete guide to using Prose is here: SiteSetupKit.com). Say hi on Twitter: @wendycholbi

    #18502

    verymom
    Participant
    Post count: 17

    I’ve been using Genesis themes for a few years, but get overwhelmed every time I deal with customizing one.

    I don’t see a Genesis -> Custom code -> Custom Functions in the menu.

    I have Genesis – Theme Settings, Design Settings, SEO Settings, Import / Export, Simple Comments, Simple Edits.

    Am I looking in the wrong place?  I’ve made other edits to the functions.php file, but this one won’t work there.

     

     

    #18524

    wendycholbi
    Participant
    Post count: 120

    Are you using Prose version 1.0? The Custom Code screen was added in version 1.5.

    You won’t see a dashboard nag to update from 1.0 to 1.5 because it requires manual updating (I wrote a tutorial about the 1.0 –> 1.5 update process).


    I love WordPress, Genesis, and the Prose child theme (my complete guide to using Prose is here: SiteSetupKit.com). Say hi on Twitter: @wendycholbi

    #18528

    verymom
    Participant
    Post count: 17

    I suppose not – it’s not a child theme so I don’t want to upgrade.  (I’ve learned to do child themes since).  Any other way to add this?

    #18541

    wendycholbi
    Participant
    Post count: 120

    Okay, I don’t know what you mean by “it’s not a child theme,” because Prose is a child theme of the Genesis Framework. Prose 1.5 has some significant improvements over version 1.0 (not the least being the Custom Code screen, but also more and better Design Settings), so my default recommendation is to update, but it’s your call as to whether that’s more trouble than it’s worth (for instance if you’ve made extensive modifications to the functions.php file).

    So, looking at your original question another way, you could probably insert your original code into one of the Genesis hooks, using the Genesis Simple Hooks plugin. Check out the Hook Reference and this Visual Hook Guide to find the hook you need.


    I love WordPress, Genesis, and the Prose child theme (my complete guide to using Prose is here: SiteSetupKit.com). Say hi on Twitter: @wendycholbi

    #18544

    verymom
    Participant
    Post count: 17

    Sorry, I meant that I directly edited Prose files rather than making a child theme to Prose.  So if I update it I will lose all my customizations.  It will be much more trouble than its worth.

    Can you explain in more detail about the hooks?  I’ve installed the plugin but the reference and hook guide gives me no clue as to how to take my code above and make it work.

    Thank you!

    #18562

    wendycholbi
    Participant
    Post count: 120

    I would try pasting your code into Genesis –> Simple Hooks –> genesis_after_post_content hook (it’s in the section of the page titled “Post/Page Hooks”.

    Check the “Execute PHP on this hook?” checkbox, since your code contains PHP. Save your changes and see if the navigation links show up correctly on a single post.

    I tested this on a test site of mine, and this code worked (note the two closing div tags that were missing from your original code above):

    <div class="navigation">
    <div class="alignleft">
    <?php previous_post('&laquo; &laquo; %',
    'Toward The Past: ', 'yes'); ?>
    </div>
    <div class="alignright">
    <?php next_post('% &raquo; &raquo; ',
    'Toward The Future: ', 'yes'); ?>
    </div>
    </div>


    I love WordPress, Genesis, and the Prose child theme (my complete guide to using Prose is here: SiteSetupKit.com). Say hi on Twitter: @wendycholbi

    #18567

    verymom
    Participant
    Post count: 17

    Oh thank you!!  That worked, yay!

    #18570

    verymom
    Participant
    Post count: 17

    Oh shoot – it’s showing up on the main blog page, not just on single posts.  I have it in this section:
    genesis_after_post_content
    What can I do to make it only show on the single posts?

    #18572

    verymom
    Participant
    Post count: 17

    Oh nevermind, I just added it to the
    genesis_after_comment_form
    area and that solved it.

     

    Thanks for all your help!

    #18575

    wendycholbi
    Participant
    Post count: 120

    Hooray! Glad to hear you got it working.


    I love WordPress, Genesis, and the Prose child theme (my complete guide to using Prose is here: SiteSetupKit.com). Say hi on Twitter: @wendycholbi

    #20121

    NewSeasonDesign
    Participant
    Post count: 35

    This worked great!

    #20123

    NewSeasonDesign
    Participant
    Post count: 35

    And thanks so much!!

    #20707

    wendycholbi
    Participant
    Post count: 120

    Glad to hear it worked for you too!


    I love WordPress, Genesis, and the Prose child theme (my complete guide to using Prose is here: SiteSetupKit.com). Say hi on Twitter: @wendycholbi

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

The topic ‘previous post / next post’ is closed to new replies.