Two problems: featured posts and easy archives...

Discussion in 'BlogSpring WordPress Theme.' started by maltrain, Feb 23, 2015.

  1. maltrain

    maltrain Guest

    Joined:
    Feb 21, 2015
    Messages:
    5
    Likes Received:
    0
    Hi. I'll try to explain my self.

    My blog: www.blogtodojuegos.cl

    First:
    Is there a way of having easy access to all my articles on a section? I mean, for example, I have 5 "featured" articles on every section and 13 "latest" and "popular" ones to the left. BUT I don´t have any option for finding, cronologically, all the articles on that particular section. Only way I figured it out is putting EVERY article as a "featured" for having the list below (1, 2, 3, etc).
    Is there another way?

    Second:
    That leads me to my other problem. If I'm forced to "featured" every article for having the easy access to my blogs in sections, I can't really "feature" real interesting articles on my home page. So... if you don´t have a solution for the above question, is there a way of "featuring" articles for section, I mean, "featuring" on "section opinion", for example, but NOT on the home page?

    Both options would be great.

    Thanks.
     
  2. maltrain

    maltrain Guest

    Joined:
    Feb 21, 2015
    Messages:
    5
    Likes Received:
    0
  3. maltrain

    maltrain Guest

    Joined:
    Feb 21, 2015
    Messages:
    5
    Likes Received:
    0
    I add the content of all my "cathegory.php" file:

    Code:
    <?php
    /**
    * The template used to display Tag Archive pages
    *
    * @package WordPress
    *
    */
    ?>
    <?php get_header(); ?>
    <div class="home_container">
        <div class="container_24">
            <div class="grid_24">
                <div class="page_container">
                    <h2 class="page_title"><?php printf( CATEGORY_ARCHIVES, '' . single_cat_title( '', false ) . CATEGORY ); ?></h2>
                    <div class="grid_6 alpha">
                        <div id="tabvanilla" class="inkwidget">           
                            <ul class="tabnav popup">       
                                <li><a href="#" onClick="show_recent(this);" id="leadbutton2" class="leadbutton">Latest</a></li>
                                <li><a href="#" onClick="show_popular(this);" id="leadbutton1"  class="leadbutton">Popular</a></li>
                            </ul>
                            <div id="recent" class="register_tab">
                                <div id="latest_home1" class="latest_home">
                                    <!-- Start the Loop. -->
                                    <?php
                                    $current_cat = get_query_var( 'cat' );
                                    $args1 = array(
                                        'cat' => $current_cat,
                                    );
                                    $query1 = new WP_Query( $args1 );
                                    if ( $query1->have_posts() ) : while ( $query1->have_posts() ) : $query1->the_post();
                                            ?>
                                            <!--Start post-->
                                            <?php padwriting_main_post(); ?>
                                            <?php
                                        endwhile;
                                    else:
                                        ?>
                                        <div class="post">
                                            <p>
        <?php echo SORRY_NO_POST_MATCHED; ?>
                                            </p>
                                        </div>
                                    <?php
                                    endif;
                                    ?>
                                    <div class="clear"></div>
                                    <!--End post-->
                                    <?php
                                    wp_reset_query();
                                    wp_reset_postdata();
                                    ?>
                                </div>
                            </div><!--/recent-->
                            <div id="popular" class="sign_tab">
                                <div id="latest_home" class="latest_home">
                                    <?php
                                    $current_cat = get_query_var( 'cat' );
                                    $args1 = array(
                                        'cat' => $current_cat,
                                        'meta_key' => 'post_views_count',
                                        'orderby' => 'meta_value_num',
                                    );
                                    $query1 = new WP_Query( $args1 );
                                    ?>
                                    <!-- Start the Loop. -->
                                    <?php if ( $query1->have_posts() ) : while ( $query1->have_posts() ) : $query1->the_post(); ?>
                                            <!--Start post-->
                                            <?php padwriting_main_post(); ?>
                                            <?php
                                        endwhile;
                                    else:
                                        ?>
                                        <div class="post">
                                            <p>
                                                <?php echo SORRY_NO_POST_MATCHED; ?>
                                            </p>
                                        </div>
                                    <?php
                                    endif;
                                    ?>
                                    <div class="clear"></div>
                                    <!--End post-->
                                    <?php
                                    wp_reset_query();
                                    wp_reset_postdata();
                                    ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="grid_12 center">
                        <div class="featured_post">
                            <!-- Start the Loop. -->
     
                            <?php
                            global $post;
                            $limit = get_option( 'posts_per_page' );
                            $paged1 = isset( $_GET['page'] ) ? (int) $_GET['page'] : 1;
                            $current_cat = get_query_var( 'cat' );
                            if ( inkthemes_get_option( 'inkthemes_blog_post' ) != '' ) {
                                $post_limit = stripslashes( inkthemes_get_option( 'inkthemes_blog_post' ) );
                            } else {
                                $post_limit = 6;
                            }
                            $args = array(
                                'post_status' => 'publish',
                                'cat' => $current_cat,
                                'posts_per_page' => $post_limit,
                                'paged' => $paged1,
                                'orderby' => 'date',
                                'meta_value' => 'on',
                                'order' => 'DESC'
                            );
                            $query = new WP_Query( $args );
                            while ( $query->have_posts() ) : $query->the_post();
                                featured_post();
                            endwhile;               
                            echo paginate_links( array(
                            'format' => '?page=%#%',
                            'current' => $paged1,
                            'total' => $query->max_num_pages,
                            'prev_text' => __( '&laquo;' ),
                            'next_text' => __( '&raquo;' ),
                            'type' => 'list',
                        ) );
                            wp_reset_query();
                            wp_reset_postdata();
                            ?>
                        </div>
                    </div>
                </div>
                <div class="grid_6 omega">
                    <div class="sidebar">
                        <!--Start Sidebar-->
    <?php get_sidebar(); ?>
                        <!--End Sidebar-->
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
    <?php get_footer(); ?>
    As you see, I removed the code 'meta_key' => 'featured_checkbox', but if you go to http://www.blogtodojuegos.cl/?cat=15 you can see the "latest" articles (driveclub, final fantasy and sega) don't show up on the middle.
     
  4. Pramod

    Pramod Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,847
    Likes Received:
    63
    Hello !

    Which theme you are using? I am not getting theme from inkthemes on above provided link.

    Thanks & Regards
    Pramod
     

Share This Page