Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to publish posts not on the homepage

  • @formbi

    Participant

    Hey guys, this is such a noobi question I feel ashamed to ask…

    When I try making a new blog post, by default it will appear on the home page. My home page is a landing page however, so I want to have a directory e.g. mysite.com/blog/ where I will publish blog posts — and keep the rest of the site social.

    How can I do this?

    Thanks for your help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • @valuser

    Participant

    I am not far from being a noob – so take this with a grain a salt.

    Would you try it with tags ?

    One home page but only include posts with certain tags for each situation

    For your landing page (for non logged users – tag -red) So its only a “landing page” for non-logged in users.

    function xonlyinclude_tag($query) {
    if ( $query->is_home() && !is_user_logged_in()) {
    $query-> set('tag_slug__in',array('red'));
    }
    return $query;
    }
    add_filter('pre_get_posts','xonlyinclude_tag');

    For your logged in ordinary users (tag – green – normal posts)

    function onlyinclude_tag($query) {
    if ( $query->is_home() && is_user_logged_in()) {
    $query-> set('tag_slug__in',array('green'));
    }
    return $query;
    }
    add_filter('pre_get_posts','onlyinclude_tag');

    put the 2 functions in your functions.php file

    just a thought.

    @jishi

    Participant

    Why won’t you use a standart WP functionality? Go to http://yourbloghere/wp-admin/options-reading.php , it will solve your issue, I hope.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to publish posts not on the homepage’ is closed to new replies.
Skip to toolbar