Forum Replies Created

Viewing 6 replies - 16 through 21 (of 21 total)
  • Thread Starter Rihan Habib

    (@xihad1)

    Hi bcworkz, nice to meet you,,,,suppose in my database there are four categories lik cricket,footbal,tennis,badminton. Now when I reload website there shows all categories(cricket,footbal,tennis,badminton) posts, then when click on cricket in filter shows posts from cricket category, similarly work for other categories. I just want to show posts from one category after page load, then show other categories posts by click on filter,,that’s it.

    Thread Starter Rihan Habib

    (@xihad1)

    Hello Joy Nice to meet you,,,,,I made a news theme there created post grid by Isotop I make it dynamic, now when page load all categories posts show in active mode when click in specific category then show all posts under a category, I want to display one category posts after page load,how can I do this?? if u have idea help please

    <div class="post-widget m-0 white-bg">
                <div class="cate-tab-navs">
                    <div class="container">
                        <ul class="nav-justified">
                            <?php $categories = get_categories();  
    
                            foreach ( $categories as $row){
                                echo '<li><a data-target="#'.$row->name.'" data-toggle="tab">'.$row->name.'</a></li>';
                            }
                            ?> 
           
                        </ul>
                    </div>
                </div>
                <div class="cate-tab-content theme-padding">
                    <div class="container">
                        <div class="tab-content">
    
                            <?php foreach($categories as $row) : ?>
    
                            <div class="tab-pane active fade in" id="<?php echo $row->name;?>">
                                <div class="row slider-post">
    
                                    <?php
                                    // list post display here
                                    $args = array(
                                        'post_type'      => 'post',
                                        'post_status'    => 'publish',
                                        'category_name'  =>  $row->name,
                                        'posts_per_page' => 4
                                    );
    
                                    $my_result = new WP_Query($args);
    
                                    if($my_result-> have_posts()){
                                        while($my_result->have_posts()) : $my_result -> the_post();
    
                                    ?>
                                    <div class="col-sm-3 col-xs-6">
                                        <!-- post -->
                                        <div class="post style-1">
    
                                            <!-- post img -->
                                            <div class="post-thumb"> 
                                               <?php the_post_thumbnail('spc-pos-cat',array('class'=>'spc_img_class'));?>
                                                <span class="post-badge"><?php the_category();?></span>
                                                <div class="thumb-hover">
                                                    <div class="position-center-center">
                                                        <a href="<?php the_permalink();?>" class="fa fa-link"></a>
                                                    </div>
                                                </div>                                                
                                            </div>
                                            <!-- post img -->
    
                                            <!-- post details -->
                                            <div class="post-content">
                                                <h4><a href="<?php the_permalink();?>"><?php the_title();?></a></h4>
                                                <ul class="post-meta m-0">
                                                    <li><i class="icon-user"></i><?php the_author();?></li>
                                                    <li><i class="icon-clock"></i><?php the_time();?></li>
                                                </ul>
                                            </div>
                                            <!-- post details -->
    
                                        </div>
                                        <!-- post -->
    
                                    </div>
    
                                <?php endwhile;};?>
                                <?php wp_reset_query();?>
                                   
                                </div>
                            </div>
                        <?php endforeach;?>
                        </div>
                    </div>
                </div>
            </div>
    • This reply was modified 3 years, 9 months ago by Rihan Habib.
    Thread Starter Rihan Habib

    (@xihad1)

    Thanks to all

    Thread Starter Rihan Habib

    (@xihad1)

    ok

    Thread Starter Rihan Habib

    (@xihad1)

    Ok,,,I solved this issue,,thanks

    Thread Starter Rihan Habib

    (@xihad1)

    Hi Mike Cooter, thank you so much for your kind information, I made an ecommerce theme from HTML template, there I designed shop page, cart page, single product page like same to same HTML template, but I failed to design homepage for product, I didn’t find the way to include products in home page, so I want to know what is need to show product in homepage, by woocommerce shortcode I can include products in home page but there products contains woocommerce default style

Viewing 6 replies - 16 through 21 (of 21 total)