• Resolved 0x37

    (@0x37-1)


    I have 4 different pages that will have Posts occupied into it. I noticed that when I click on different posts within those pages, it opens those posts up with specific post numbers (i.e xyz..com/?p=39).

    I’m planning on giving each each of the 4 Main Pages their own headers and I foresee a problem is someone clicks on the individual posts (I’m using the_excerpt() with some “Read More” links) in that once they’re opened, they won’t show the header of the section under which it lies.

    My question is, is there a way to tie the posts and pages to avoid this problem, and without having to add is_page( ## ) on every post to include the appropriate header?

    Thank You in advance, your plugin is awesome ??

    https://www.ads-software.com/extend/plugins/posts-in-page/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter 0x37

    (@0x37-1)

    I just realized this is probably in the General WordPress Support Forum as opposed to the Plugins Support. If there are any moderators here, I apologize!

    Edit: Nope, I’m in the right place ??

    Plugin Author Eric Amundson

    (@sewmyheadon)

    Hey 0x37,

    Honestly, I’m not sure I understand your question.

    Are you saying that the posts don’t show as subs of the Page they’re on? Like, you’d rather have them behave like sub-pages?

    Or, are you saying that if you have a page (let’s call it “Food” because I’m hungry) and you’re pulling in a few posts to display in that page, that when a user follows the link to the post, your navigation won’t show them as being in the “Food” page/section anymore?

    Thanks,
    Eric

    Thread Starter 0x37

    (@0x37-1)

    Hey Eric,

    I apologize for the confusion. Let me explain. I have a page called “News” and its URL is https://domain.com/?page_id=42. This page lists all the posts I have with the category of “News”, and it does so successfully. It lists 3 Test Posts I’ve made. When I click on one post, the URL now changes to: https://domain.com/?p=39.

    What I plan to do, is give every page its own header image. So “News” may be a picture of a newspaper with the website title. My worry is that i’m thinking ahead (and my WordPress-fu is not strong so if you see a solution that can circumvent this let me know).

    I poked around as to how to give each page its own specific header, and learned that i can do it on a page basis : set header A when page_id = X (bear with me on the primitive description). This would work when you look at the “News” page, but if you were to click on a particular news article/post, where the url now includes p=39, as opposed to the page_id which we were just on, it would not display the specific News header (the newspaper image) anymore.

    My question is if, using the plugin, i can further associate the posts with the page they’re on, to make sure that when a user opens up the news article, they still see a specific header (in this case the newspaper image).

    Thank you again for your help.

    Plugin Author Eric Amundson

    (@sewmyheadon)

    Howdy 0x37,

    Thanks; now I understand.

    The short answer to your question is: “no.”

    The somewhat longer answer is:

    This isn’t something you can do within the plugin, but it could probably be done in your theme. Within the WordPress Template Hierarchy, it’s possible to create a template that will be used to render all posts (single.php) and, inside that template you could add some Conditional Tags to show only certain content for certain categories (ex. show this banner if it’s in_category ‘news’).

    More on Conditional Tags

    Here’s a thread on the forum that addresses this issue:

    https://www.ads-software.com/support/topic/alternate-single-post-template-for-specific-categories?replies=14

    I hope this helps!
    Eric

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Post URLs Tied to Page URLs’ is closed to new replies.