WordPress.org

Ready to get started?Download WordPress

Forums

Path
Having articles not appear on front page (8 posts)

  1. hayden34
    Member
    Posted 6 months ago #

    Just wondering if there is a way for me to post articles directly to the "Locker Room" page, and have them not appear on the front page with every other article?
    http://www.downtownball.net

  2. Jesin A
    Member
    Posted 6 months ago #

    Create a "Page" with the content you'd like on your front page. Let's name it "My Home"

    Delete the "Locker Room" category.

    Create another blank "Page" and save it with the name "Locker Room".

    Go to General > Reading and choose "A static page" for "Front page displays"

    Front Page -> My Home
    Posts Page -> Locker Room

    More info http://codex.wordpress.org/Settings_Reading_Screen

  3. hayden34
    Member
    Posted 6 months ago #

    But how do i dictate which page certain posts goto?

  4. Jesin A
    Member
    Posted 6 months ago #

    Create categories and assign those pages to the respective ones.

  5. hayden34
    Member
    Posted 6 months ago #

    how do i assign pages to categories?
    Is that what i have done with the authors?

    If i do it the same way, won't every post still appear on the front page?

  6. Jesin A
    Member
    Posted 6 months ago #

    how do i assign pages to categories?

    Sorry for using the word pages, I actually meant posts. Edit a post and you'll find a list of categories on the right side with checkboxes for each.

    Then you place those categories on your menu bar. Clicking those will list posts assigned to them.

    If i do it the same way, won't every post still appear on the front page?

    No it won't because you've set the "Front Page" option to the "My Home" page. So only the contents of this page will be displayed in the front.

  7. hayden34
    Member
    Posted 6 months ago #

    Sorry, i am so confused.

    But when i create a category (like i have for the headings under the WHO option), i can not put these pages into the Reading Settings and set these different categories as Front Page and Posts page.

  8. Jesin A
    Member
    Posted 6 months ago #

    OK I understood what you are trying to achieve. You want to display certain posts in the home page and the rest somewhere else, am I right?

    Items under the "WHO" menu are all authors (people who write content in your blog). Categories are found under Posts > Categories.

    Go to this page and create a category.

    Name => Home Posts
    Slug => home-posts

    Create a child theme and activate it in Appearance > Themes.

    Create a functions.php file inside wp-content/themes/path-child with the following code

    <?php
    add_action('pre_get_posts','home_display');
    
    function home_display($query)
    {
    	if($query->is_home() && $query->is_main_query())
    	{
    		$query->set('category_name','home-posts');
    	}
    }

    Edit the posts you'd like to show in the front page and place them in the "Home Posts" category.

    Now your home page will display only these posts.

Reply

You must log in to post.

About this Theme

About this Topic