• Hi,

    In my blog I have two different categories for two different blog pages: blog and deals. I have found out that in December there must have been some update and all my system collapsed.

    Today I was redoing it, I created an additional page template, change the category and… it does not work.

    The only thing I had to change before was as follows:

    if(!empty($optimizer[‘blog_cat_id’])){
    $blogcat = $optimizer[‘blog_cat_id’];
    $blogcats =implode(‘,’, $blogcat);
    }else{$blogcats = ”;}
    $args = array(
    ‘post_type’ => ‘post’,
    ‘cat’ => ”.$deals.”,

    And I would change in the other page template as well.

    Any idea how can I fix this??? It is very important for me, please explain with easy words, I am no IT.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author OptimizerWP

    (@layerthemes)

    @howevatravels You should not edit template files.

    You can display posts in a certain category by simply just adding the categories to your menu. Just go to Appearance > Menus and add the categories you would like to display to your menu from the “Categories” box on left.

    Regards

    xpobar

    (@xpobar)

    Did you ever manage to find a way to do this?

    The layout for category layout is quite different, so I can’t use this method.

    I’m using Optimizer.

    Thanks

    x

    xpobar

    (@xpobar)

    Possibly, this may help someone else??

    I created two categories: myCatOne and myCatTwo, these categories were then applied to the relevant posts.

    Then I duplicated the template for the blog ‘page-blog_template’ and added the following code.

    <!--CUSTOM PAGE HEADER ENDS-->
    
      <?php  
    
           $args = array(
    	'category'         => 'myCatOne',
    	'category_name'    => 'myCatOne',
    	'exclude'          => 'myCatTwo',
                         'post_type' => 'post',
                         'posts_per_page' => '');
          $the_query = new WP_Query( $args );
       ?>
    
        <div class="lay4">
            <div class="center">
    
                <div class="lay4_wrap<?php if ( !is_active_sidebar( 'sidebar' ) ) { ?> no_sidebar<?php } ?>">
                    <div class="lay4_inner">
    
                          <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
                          <div <?php post_class(); ?> id="post-<?php the_ID(); ?>"> 
    
                    <!--POST THUMBNAIL START-->

    In the original template, use the same code, but swap over the ‘myCatOne’ and ‘myCatTwo’ values

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘2 blogs with different categories’ is closed to new replies.