Sunday, March 31, 2019

To count total no of post in category

<?php

                $args = array(

                    'type'                     => 'trek',

                    'child_of'                 => 0,

                    'parent'                   => '',

                    'orderby'                  => 'name',

                    'order'                    => 'ASC',

                    'hide_empty'               => 1,

                    'hierarchical'             => 1,

                    'exclude'                  => '',

                    'include'                  => '2',  //this is category id

                    'number'                   => '',

                    'taxonomy'                 => 'destination',

                    'pad_counts'               => false );

                $categories = get_categories($args);

              foreach ($categories as $category) {

              $url = get_term_link($category);

              $postsInCat = get_term($category);

              $postsInCat = $postsInCat->count;

               $cat = $category
                     
             
               ?><?php } ?>
             <?php echo $postsInCat; ?>

gallery css

.gallery {
    display:grid;
    justify-content: space-between;
    grid-gap:20px;
    grid-template-columns: repeat(7, 1fr);
}

.gallery-item{
    display:inline-block;
 
}
.gallery-item img{
     padding: 10px 10px 10px 10px;
    border: 1px solid #000;
        margin-right: 20px;
}

Thursday, March 28, 2019

polylang dispalying flags

https://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/

To show all category title and description make archive-trek.php

<?php



/**



 * The template for displaying archive pages.



 *



 * @link https://codex.wordpress.org/Template_Hierarchy



 *





 * @package himalayanrangetreks



 */









get_header(); ?>







    <?php

if ( have_posts() ) : ?>

<div class="best_selling">

  <div class="container">

   

    <div class="row">



      <div class="col-md-12 col-sm-12  col-lg-12">



       


</br></br>
          <h2><strong><?php



the_archive_title();?></strong>



</h2>
 



</h2>


      </div>



    </div>

    <?php $custom_terms = get_terms('trek_category');



foreach($custom_terms as $custom_term) {

    wp_reset_query();

    $args = array('post_type' => 'trek',

'order'=>'ASC',

        'tax_query' => array(

            array(

                'taxonomy' => 'trek_category',

                'field' => 'slug',

                'terms' => $custom_term->slug,

            ),

        ),

     );



     $loop = new WP_Query($args);

     if($loop->have_posts()) {?>
    </br>
     <h2 class="cat_title"><?php echo $custom_term->name;?></h2>
<p class="cat_title m-tb-10"><?php echo $custom_term->description;?></p>

    <div class="row archive_list">

<?php while($loop->have_posts()) : $loop->the_post();?>



      <div class="col-md-3 col-sm-3">

      <div class="trek_list">

        <figure class="Trek_img">

          <?php

              if(has_post_thumbnail() ) {

                the_post_thumbnail('');

              } ?>

          <?php if(get_field('price')):?>

          <span class="price">

          <?php the_field('price');?>

          </span>

          <?php endif;?>

        </figure>

        <div class="trek_box">

        <div class="Intiligent_holder">

          <h3><a href="<?php the_permalink(); ?>">

            <?php the_title();?>

            </a></h3>

         
         
 </div>

          </div>

          </div>

      </div>



     <?php







          endwhile;







          wp_reset_postdata();







          ?> 



    </div>



   <?php



    }



  }







wp_reset_query();  // Restore global post data stomped by the_post().



?>



  </div>



</div>



       



       









<?php endif; ?>





<?php







get_footer();?>



Thursday, March 21, 2019

wptravelengine plugins

https://wptravelengine.com/page/2/?fbclid=IwAR1Wr_e5AGlrjx4B_EUqJRZLrA2QIakp_dVOeTTvVod-_aWrpXRB3KvIEDk


https://wensolutions.com/travel-log-demo/

on-page-seo-techniques/

https://raratheme.com/blog/on-page-seo-techniques/

make-money-online using blogging wordpress

https://www.wpbeginner.com/beginners-guide/make-money-online/?utm_source=pushnotification&utm_medium=onesignal&utm_campaign=blogpush

Featured Post

Make money online

https://www.wpbeginner.com/beginners-guide/make-money-online/?fbclid=IwAR0_9_5aHmbB4rDisaPevdnO4uAgo0N9heHgPu1TjerjurE5ilD2NyzeB2A

Popular Posts