Jump to content
vergilst

Add PostNav to custom post template

Recommended Posts

vergilst    1
vergilst

Is it possible to add PostNav to the Content Area of custom template?

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi,

 

The Post Nav only works with posts and not the page templates. Therefore, it won't work as far as I know with custom page templates.

 

May I ask why you want this section on a page when it allows you to navigate between posts.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
vergilst    1
vergilst

Hi

 

I started work on a 'dictionary' site, based on a third party plugin.

 

The entries in the dictionary are custom post types and I have a 'Dictionary' template in PL Teplate Setup area, but I can't add the PostNav section...

 

I need it to navigate between those custom posts :)

 

Thanks

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

OK, I understand.

 

Basically, what you're going to need to do is create a child PostNav section. Simply download a fresh copy of PageLines Framework from your Launchpad, extract the zip and navigate to the sections folder. Then upload the PostNav section folder to your child themes sections folder. If you do not use a child theme, you will need to inorder to create a child section of PostNav.

 

Once you have completed the above, edit the section.php file for the child theme PostNav section, on the Workswith: add main

 

So that, the Workswith line looks like this:

 

Workswith: main-single, main

 

Save the changes to the files, upload the file and then go to PageLines > Store, now go back to Drag and Drop, select your custom post type template and the PostNav section should be visible.

No other changes are needed, as the section will automatically support navigation between your post type.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
vergilst    1
vergilst

Thanks, Danny

 

I uploaded the PostNav section in /pagelines-template-theme/sections/ (Base Theme is active), I can see it in Store - Sections - Child Theme, but I don't know how to use 'workswith'...

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

You need to go to the PostNav folder you uploaded to the child themes section folder. In the PostNav folder there will be a file called sections.php, open this file which you can do if you have configured your FTP client correctly.


Once the file is open you will see a Workswith: which should be on line 8, make the changes and then save the file, once the file is saved your FTP client should upload the file with the changes.

 

Once you have completed the above, you will be able to use the PostNav section on your Custom post type template.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
vergilst    1
vergilst

Thanks for the help Danny! It's OK now!

 

Thanks again, and best wishes for the New Year :)

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

No problem, happy to help and all the best for the new year too!


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • bloom1creative
      By bloom1creative+
      Hey
       
      Having issues with the PostNav section.  I'm using it on custom post types with your Docker plugin, but on the first and last post of each Post Type, it displays the previous post and next post as a clone, so there are two of the same one.  You can see it on the following link:
       
      http://www.ramemarketing.co.uk/contentstrategies/the-rame-blog/16-reasons-to-invest/16-reasons-invest-content-marketing/
       
      Many thanks
       
      Rob
    • caspersjan
      By caspersjan
      Dear Pagelines team, leafing through the Forums, I found an old solution to a problem I am facing: How to make the PostNav section include posts from the same category only? This is the suggested fix:
       
      BEST ANSWER The Farside, 14 August 2012 - 04:06 AM
      I seem to have figured it out, but if this is wrong or if there is another way, let me know.
      Here is what I've done in the sections directory for postnav section.php
       
      <span class="previous"><?php previous_post_link('%link', $link='%title', $in_same_cat = true); ?></span>
                      <span class="next"><?php next_post_link('%link', $link='%title', $in_same_cat = true); ?></span>
       
      I found the postnav section.php (wp-content/themes/dms/dms/sections/navbar). Do I just add the above code? And would it still be valid in DMS2 (it's ancient - from 2012!) I am hesitant as I am always afraid to break things when dealing with PHP. Or is there another way, a plugin or child theme that lets me add this in a safer way (and one that may withstand upgrades)? 
       
      Thank you for your help and advice. It is always a pleasure working with Pagelines, every day!  I should say that more often, but of course yet again it is only when there is a problem that I get in touch...
       
      Yours faithfully, Jan.
    • mtaus
      By mtaus+
      I have been able to add PostNav to individual Post pages, but when I attempt to add it to the bottom of a Category or Tag page, I'm unable. The PostNav icon is greyed out, so I'm assuming that it's not allowed. I just can't figure out why it would not be allowed.
       
      Any help would be appreciated.
    • Toby
      By Toby
      Hi, I would like to know if there is a way to change the 'postnav' section to display a selection of pages in the same way it does posts.
      This will allow my user to flick through similar pages within a group.
       
      Thanks
×