• I want the post I write to go to certain pages instead of just on the homepage. I figured out how to customize the layout of each page separately but I don’t see an option anywhere to add specific post to one page only.

    This website will be more than a blog, It’ll be a dual blog on two separate pages, then I’ll have a gallery page and perhaps a debate page on top of that. Primarily the homepage will be used to notify readers of new pictures and post so they can go to the corresponding page.

    Right now I’m just trying to get the two blog pages up and running, having two different blogs is going to be the theme of the website, so it’s crucial that I can do this.

    I’ve heard something about using categories to achieve this, but have also heard that this approach has limitations.

    Any ideas on the best way to do this?
    Should I use a plugin?
    Or built in features of WordPress?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Ahhh yes, this is something I’ve been interested in as well, but unfortunately have not had time to implement it.

    You may want to check out get_the _category().

    My plan is to separate an “article” category onto a specific page.

    For this I was thinking I might use something like the following:
    Get the post category if you have a custom post_type

    <?php
    /* FIRST
     * Note: This function only returns results from the default “category” taxonomy. For custom taxonomies use get_the_terms().
     */
    $categories = get_the_terms( $post->ID, 'taxonomy' );
    // now you can view your category in array:
    // using var_dump( $categories );
    // or you can take all with foreach:
    foreach( $categories as $category ) {
        echo $category->term_id . ', ' . $category->slug . ', ' . $category->name . '<br />';
    }
    Thread Starter mikenet7482

    (@mikenet7482)

    Seems complicated, I have rudimentary html and css knowledge, php I haven’t learned yet. So it seems that I need to edit category-template.php and add something like that. I’m not sure how this will work in combination with WordPress category options, or where in the php file I should add a line like that. I have a child theme and a backup to experiment with if I know exactly where to add code. Hrmm

    I wish there was an easy way to do this, I bet many people want two different blogs on one site to cover two different topics. Or at least having post go to certain pages, I see that when surfing the web all the time.

    I think you can do this by making a page template. You could start by simply copying page.php. Inside the page is “The Loop”:

    <?php while ( have_posts() ) : the_post(); ?>

    Perhaps by simply inserting a category type, such as the_post( 'article' ) would work. I haven’t tested this yet though. Siteground’s website mentions being able to use <?php query_posts( 'cat=33' ); ?> to do it. Lemme know if you get it to work.

    Thread Starter mikenet7482

    (@mikenet7482)

    Hey guys, I started working with this plugin before I got the advice on the php edits. I’m not sure if it will work well, I’m just getting familiar with it.

    The plugin wants me to use shortcodes in the field where I create the page or post. This is the plugin…

    https://www.ads-software.com/plugins/add-posts-to-pages/

    It seems to have pretty good ratings, hopefully it doesn’t have too many limitations for the post that are created. I’ll let yall know how it goes, if I can’t get it to work i’m going to take a stab at what’s being suggested here. It’ll be tough though, I know little about php.

    Ya, if you can find a plugin that suits your needs, go for it. No need to reinvent the wheel!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘I need to have page specific posting, any ideas?’ is closed to new replies.