• Hi, all –

    I’ve created the following Page-centric site:

    https://www.scopedin.com

    I want to add a “what’s new” section, that would read sort of like a running list of release notes, with the newest at the top. From my limited understanding of posts, they would seem to be a good way to do this. Can I somehow add a “what’s new” link to a *post* in my main navigation bar?

    If there’s a better way to do this, please tell me. Thanks…

    mz

Viewing 11 replies - 1 through 11 (of 11 total)
  • Since you are using the latest WP, go to admin > Options > Reading and select a “page” as your posts page. (if it doesn’t exist, create one > What’s New as title)
    All your posts should show up on that Page.

    Thread Starter mzimmers

    (@mzimmers)

    Thanks, Moshu. That seems to have worked fine, but…any idea why it wiped out my navigation bar to the in the left column?

    Just a guess… Although it is a Page, when it comes to the is_page condition WP doesn’t consider it as a Page anymore because it is practically a multipost view (like index, archives etc.) would be.

    I have to check this “theory” on a test install but that would be my first thought.

    Thread Starter mzimmers

    (@mzimmers)

    Yeah…that approach is causing me some other problems, too (currently only of the validity kind). Any other way to do this?

    Thread Starter mzimmers

    (@mzimmers)

    OK…I have an idea for a hack. Is there a way to determine whether the current post is the “posts page?” The problem I face now is that WP returns the ID of the post, not the posts page (if that makes sense).

    If I can determine that the current post is “from” the posts page, I can hard-code a workaround.

    Thanks…

    Oddly enough, on my test install the “posts” page responds to the conditional is_home, while the static frontpage (set in Options reading) is applying the conditional is_page(‘ID#’).

    Thread Starter mzimmers

    (@mzimmers)

    OK…so the obvious question is, is it a bug or a feature? I’m just wondering whether I should attempt to rely on this.

    Also: is there a post equivalent to wp_list_pages? One that will create a link to the post?

    Thanks…

    Also: is there a post equivalent to wp_list_pages? One that will create a link to the post?

    No, there isn’t. Why would you need that? (just curious)

    That “posts” page, depending on your settings in the Options > Reading: Show at most X… can display even 456 posts ??

    Thread Starter mzimmers

    (@mzimmers)

    I’ll try to explain why I need it, but it might be easier if you look at the code in my l_sidebar.php file.

    I need it because my theme takes advantage of the fact that wp_list_pages creates links. It uses the anchor tag as a criterion for CSS formatting. Without an analog for my post, the title text I’m trying to insert into my left sidebar won’t format the same as it does for all the Pages in my site.

    I’m sure there’s a much easier way to do what I’m trying to do, but I’m still a complete post novice, as all I’ve worked with so far has been Pages.

    Do you mean you will want all the posts titles to appear on your left sidebar?

    Before we go further an important question: that content on https://www.scopedin.com/wordpress/?page_id=77 (What’s new)
    was created in the Write Page or you did write, actually, a post (as opposed to Page)?

    Thread Starter mzimmers

    (@mzimmers)

    1. the content that displays when Page 77 comes up was generated in post 78. I believe this is the expected behavior given that Page 77 is a “posts Page.”

    2. What I want is for the title of Page 77 to appear in the left sidebar. This would be consistent with site behavior for all other Pages. What is happening, however, is that the title for page 78 appears instead. Here’s the relevant code:

    if (is_home()) {
    	$my_ID = 77;
    	$post_id_77 = get_post($my_id);
    	$my_title = $post_id_77->post_title;
    	echo $my_title;
    	$thispage = "<a href='https://www.scopedin.com/wordpress/?page_id=77'>" . $post_id_77->post_title . "</a>";

    Note: the echo statement above is only a telltale; the “real” displaying of it comes later.
    I may just have to hard-code the title of 77 into the php file.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘adding post to Page-centric site’ is closed to new replies.