WordPress.org

Ready to get started?Download WordPress

Forums

Moving individual post (with comments) from homepage to another page (9 posts)

  1. myRobertForums
    Member
    Posted 1 year ago #

    Using Twentyeleven (with Child).
    http://my-neighborhoods.net

    My blog started as a series of photo stories with emphasis on photos and slideshows, and they work nicely on the homepage.

    Recently, I've added short stories, which I think of differently than the photo stories. Not knowing how to create another blog page with comments, I just added the short stories to the homepage blog.

    Now I would like to move just the short stories to another page, and call it "Short Stories," thus having two blog pages, each allowing for visitors to comment.

    I hope I explained this clearly.

    I know HTML and CSS quite well, but digging around in PHP often confounds me.

    If you answer, would you please give me some specific advice and answer, rather than, "Sure, you can do that," or "Yes, edit such-and-such page."

    Thanks!

    Bob

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    do these posts have different categories?

    if yes,
    then exclude the 'short stories' from the home page;
    and add them to a new page which needs to use a page template.

    - exclude a category from the main posts page (home page):

    add this to functions.php of your child theme:

    function exclude_category( $query ) {
        if ( $query->is_home() && $query->is_main_query() ) {
            $query->set( 'cat', '-147' );
        }
    }
    add_action( 'pre_get_posts', 'exclude_category' );

    you need to replace 147 with the ID of the category 'short stories'

    http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts
    http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts#Exclude_categories_on_your_main_page

    - create a page template for the 'short stories' category:

    http://codex.wordpress.org/Page_Templates

    review that Codex chapter and see how far you get with that information; if you hit specific problems, please post here again.

  3. myRobertForums
    Member
    Posted 1 year ago #

    Thanks alchymtyh,

    As I had mentioned, I know HTML and CSS.

    I have added another "page" to http://my-neighborhoods.net which I named "Alpha Portraits and Stories," using the Sidebar Template.

    I did not add your suggested code to my functions.php of my child theme because I didn't know what the ID of the "Alpha Portraits and Stories" is, nor how to find it. I finally did find it, though.

    The Page ID for "Alpha Portraits and Stories" appears to be:
    http://my-neighborhoods.net/?page_id=1047

    So, if this is the case, you recommend going to the functions.php of my child theme and pasting the code and changing the ID from 147 to 1047 (with the dash: -147 to -1047

    As you can see, currently the <!--more--> has no effect on this new page, though it does on the homepage. Will this be in effect with the change?

    There never seems to be an easy or straight-forward answer to these things, such as going into Admin and clicking a box that says "Page" or "Blog" or "Move this page to be a sub-page of X." As a result, confusion develops and hesitation reigns.

    I appreciate your help,

    Bob

  4. myRobertForums
    Member
    Posted 1 year ago #

    Hello, again, alchymyth,

    This is another subject, but is in response to a post you made a year ago about modifying the Page Title. I apologize if this is not the appropriate place.

    You recommended adding and modifying this to the child style.css:

    .singular .entry-title {
    color: #000;
    font-size: 36px;
    font-weight: bold;
    line-height: 48px;
    }

    Mine is this:
    .singular .entry-title {
    color: #990033;
    font-size: 16pt;
    font-weight: bold;
    line-height: 18pt;
    }

    It works here:
    http://my-neighborhoods.net/2013/05/03/a-kind-of-anguish/

    But not here:
    http://my-neighborhoods.net

    or on the page currently under scrutiny:
    http://my-neighborhoods.net/alpha-portraits-and-stories/

    Any suggestions?

    Thanks, again,
    Bob

  5. myRobertForums
    Member
    Posted 1 year ago #

    Also, the header modifications work on the other parent pages, such as:
    http://my-neighborhoods.net/about/

    Bob

  6. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    The Page ID for "Alpha Portraits and Stories" appears to be

    it is not about the page Id, you need the category ID. you can find that for instance when you goto dashboard - posts - categories and hover over the category name, you see the url in the bottom left of the browser; example: http://localhost/wordpress/wp-admin/edit-tags.php?action=edit&taxonomy=category&tag_ID=3&post_type=post where 3 in the example is the category ID: tag_ID=3

    in your site, for example, 'stories' is category ID 23 ...

    As you can see, currently the <!--more--> has no effect on this new page,

    that is a static page, and the 'more-tag' does not have effect on a static page. it should work in a 'page-of-posts' page template; if not, review http://codex.wordpress.org/Customizing_the_Read_More#How_to_use_Read_More_in_Pages

    But not here:

    that is because .singular is the body_class of posts or pages without sidebar;
    for a static page with sidebar, you could use an additional style, example:

    .page .entry-title { }

    or generally:

    .entry-title { }

  7. myRobertForums
    Member
    Posted 1 year ago #

    Thanks alchymyth,

    I'll work on the more complicated page coding, but for now, I'm still having trouble with the page title.

    This is what I already have
    .singular .entry-title {
    color: #990033;
    font-size: 16pt;
    font-weight: bold;
    line-height: 18pt;
    margin-top:4px;
    padding-top:0px;
    }

    When I add .page, either there is no change, or all of my page title revert to the same as the homepage.

    I've tried .singular .page .entry-title {
    -- and there is no change.

    When I try .singular .entry-title .page {
    -- then all of the page titles revert to the same as homepage.

    As it is, my the page titles for my stories, and all of the page titles except for Home and Alpha Portraits & Stories change to my CSS.

    When I try this:
    .page {
    color: #990033;
    font-size: 16pt;
    font-weight: bold;
    line-height: 18pt;
    margin-top:4px;
    padding-top:0px;
    }

    Then the content of the page changes, not just the title.

    Is there something like .sidebar but for the default or showcase templates, such as .default or .showcase?

    Thanks,

    Bob

  8. myRobertForums
    Member
    Posted 1 year ago #

    Alchymyth,

    Just wanted to get back to thank you for your advice.

    I did make the changes to my child function.php page and now only my photo-journeys appear on my homepage.

    For my "Alpha..." page, since it is static, I simply made it singular and the page title conforms to the others (except Home), and I made a list with links to my individual stories, along with a small abstract. It's manual, but I only have to do it with each additional story as I post them.

    Still can't eliminate the space above and below the Page Title--I've tried every suggestion (most are the same), but it still looks OK and it works.
    :-)

    http://my-neighborhoods.net/

    http://my-neighborhoods.net/alpha-portraits-and-stories/

    Bob

  9. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    the spaces below and above the page title are some top paddings;

    possibly reduce them it with this kind of style in style.css of the child theme:

    /* space above page title; was 4.875em */
    .singular.page .hentry { padding-top: 1.7em; }
    /*space below page title; was 1.625em */
    .entry-content { padding-top: 0.5em; }

    any browser inspection tool should be helpful in identifying these styles;
    I prefer to work with Firefox' web developer add-on https://addons.mozilla.org/en-US/firefox/addon/web-developer/

Topic Closed

This topic has been closed to new replies.

About this Topic