Friday, November 30, 2018

Book now

Html part

<div class="book_btn">
            <?php global $post; ?>
            <a href="<?php echo esc_url( home_url( '/' ) ); ?>booking-form?trip_title=<?php echo urlencode(get_the_title($post->ID)); ?>">Book Now</a> </div>


Inside contact form

<p>Trip Name: [dynamictext my_title  " CF7_GET key='trip_title'"]</p>

Tuesday, November 27, 2018

Friday, November 23, 2018

Pagination in wp

https://www.wpbeginner.com/wp-themes/how-to-add-numeric-pagination-in-your-wordpress-theme/

Thursday, November 22, 2018

change english date to nepali date

http://prakashbhandari.info.np/php-function-change-string-number-into-unicode-number/

Function to show category according to postwise

<?php
      $terms = get_the_terms( $post->ID , 'category' );
      foreach ( $terms as $term ) {
      ?>

<?php echo $terms; ?>

Tuesday, November 20, 2018

Facebook comment

<div class="fb-comments" data-href="<?php the_permalink(); ?>" data-numposts="10" data-colorscheme="light" data-width="100%"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.6&appId=818080668278662";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<script type="text/javascript">var switchTo5x=true;</script>

Monday, November 19, 2018

https://www.wpbeginner.com/wp-tutorials/how-to-limit-search-results-for-specific-post-types-in-wordpress/

https://www.wpbeginner.com/blueprint/
https://www.wpbeginner.com/beginners-guide/website-marketing-data-you-must-track-on-every-wordpress-site/?fbclid=IwAR2TvlcMSW1fQCA0VzaBuFluTigMT8DLavIqrEWF5DgAuZ0eYpycki7vcKk

Monday, November 5, 2018

यमपञ्चकको दोस्रो दिन आज कुकुर तिहार


यमपञ्चकको दोस्रो दिन आज कुकुर तिहार मनाइँदै छ । हिन्दू धर्मावलम्बी सबै नेपालीका घर आँगनमा कुकुरलाई टीका तथा माला लगाइदिएर मीठा–मीठा खानेकुरा खान दिई पूजा गरिँदै छ ।
यस दिन कुकुरको पूजा नगरी खाना खाएमा पापी भइन्छ भन्ने भनाइ छ । प्रत्येक वर्षको कात्तिक कृष्ण चतुर्दशीका दिन कुकुरको पूजा गरिन्छ । यस दिनलाई नरक चतुर्दशी पनि भनिन्छ ।
कुकुर घरपालुवा आज्ञाकारी, घर रक्षक एवं गुनिलो जनावर पनि हो । यो जनावरले सुँघेर अपराधी पत्ता लगाउने गर्छ । कुकुरलाई भैरवको बहान पनि भनिन्छ । त्यसैगरी विनासकारी प्राकृतिक प्रकोप तथा दैवी विपत्ती हुने बेलामा कुकुरले सुँघेर वा दायाँबायाँ कराई पूर्वसूचना दिने गर्दछ । कुकुर इमान्दार र वफादार जनावर हो । घरको रेखदेख गर्ने काम पनि कुकुरले नै गर्दछ ।
परापूर्वकालदेखि कुकुरलाई वर्षमा एकपटक इमान्दार पहरेदार जन्तुका रूपमा पूजा गर्ने चलन छ । कुकुरका गुणको कदर गरेर मानिसले वर्षमा एकपटक यमपञ्चकको दोस्रो दिन पारेर पुज्ने गर्दछन् ।
सत्यवादी धर्मराज युधिष्ठिरलाई स्वर्गयात्रामा समेत साथ दिने सौभाग्य पाएको कुकुरको मानव जातिसँंग घनिष्ठ सम्बन्ध रहेको पुराणमा उल्लेख छ ।
यस दिन मासको पात खाने चलन पनि छ । लिंग पुराणअनुसार यस दिन मासको पातको साग खानाले मानिसको सबै पाप नास हुन्छन् भन्ने जनश्रुति पाइन्छ ।
यस दिन पाप नाश गर्न तथा नरकलाई खुशी पार्न नर्के नुहाउने चलन छ । नुहाइसकेपछि दीपदान गर्ने तथा आलसको बोट बालेर आगो ताप्ने प्रचलन छ । यसो गर्दा स्वर्ग गइन्छ भन्ने विश्वास छ ।

Sunday, November 4, 2018

तिहारको पहिलो दिन (काग को पुजा )

The five-day  festival of lights, known as Tihar honors Yama, the God of Death, meanwhile the worship of Laxmi, the Goddess of Wealth dominates the festivities.
On the first day Kaag Tihar, is the day of the crow, the informant of Yama is worshipped. 

Friday, November 2, 2018

Function to show excerpt

Php function
function news_excerpt($full_text, $letter_count = 50){

$full_text = trim($full_text);

$full_text = strip_tags($full_text);

$full_text = strip_shortcodes($full_text);

$full_text = mb_substr($full_text, 0, $letter_count);

$full_text = $full_text."...";

return $full_text;

}

Html
<?php echo news_excerpt(get_the_content(),100);?>

Thursday, November 1, 2018

How to display breadcrum without using plugin

//// BREADCRUMB START ////       
 function the_breadcrumb() {
 
  $showOnHome = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show
  $delimiter = '&raquo;'; // delimiter between crumbs
  $home = 'Home'; // text for the 'Home' link
  $showCurrent = 1; // 1 - show current post/page title in breadcrumbs, 0 - don't show
  $before = '<span class="current">'; // tag before the current crumb
  $after = '</span>'; // tag after the current crumb
 
  global $post;
  $homeLink = get_bloginfo('url');
 
  if (is_home() || is_front_page()) {
 
    if ($showOnHome == 1) echo '<div id="crumbs"><a href="' . $homeLink . '">' . $home . '</a></div>';
 
  } else {
 
    echo '<div id="crumbs"><a href="' . $homeLink . '">' . $home . '</a> ' . $delimiter . ' ';
 
    if ( is_category() ) {
      $thisCat = get_category(get_query_var('cat'), false);
      if ($thisCat->parent != 0) echo get_category_parents($thisCat->parent, TRUE, ' ' . $delimiter . ' ');
      echo $before . 'Archive by category "' . single_cat_title('', false) . '"' . $after;
 
    } elseif ( is_search() ) {
      echo $before . 'Search results for "' . get_search_query() . '"' . $after;
 
    } elseif ( is_day() ) {
      echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
      echo '<a href="' . get_month_link(get_the_time('Y'),get_the_time('m')) . '">' . get_the_time('F') . '</a> ' . $delimiter . ' ';
      echo $before . get_the_time('d') . $after;
 
    } elseif ( is_month() ) {
      echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
      echo $before . get_the_time('F') . $after;
 
    } elseif ( is_year() ) {
      echo $before . get_the_time('Y') . $after;
 
    } elseif ( is_single() && !is_attachment() ) {
      if ( get_post_type() != 'post' ) {
        $post_type = get_post_type_object(get_post_type());
        $slug = $post_type->rewrite;
        echo '<a href="' . $homeLink . '/' . $slug['slug'] . '/">' . $post_type->labels->singular_name . '</a>';
        if ($showCurrent == 1) echo ' ' . $delimiter . ' ' . $before . get_the_title() . $after;
      } else {
        $cat = get_the_category(); $cat = $cat[0];
        $cats = get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
        if ($showCurrent == 0) $cats = preg_replace("#^(.+)\s$delimiter\s$#", "$1", $cats);
        echo $cats;
        if ($showCurrent == 1) echo $before . get_the_title() . $after;
      }
 
    } elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {
      $post_type = get_post_type_object(get_post_type());
      echo $before . $post_type->labels->singular_name . $after;
 
    } elseif ( is_attachment() ) {
      $parent = get_post($post->post_parent);
      $cat = get_the_category($parent->ID); $cat = $cat[0];
      echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
      echo '<a href="' . get_permalink($parent) . '">' . $parent->post_title . '</a>';
      if ($showCurrent == 1) echo ' ' . $delimiter . ' ' . $before . get_the_title() . $after;
 
    } elseif ( is_page() && !$post->post_parent ) {
      if ($showCurrent == 1) echo $before . get_the_title() . $after;
 
    } elseif ( is_page() && $post->post_parent ) {
      $parent_id  = $post->post_parent;
      $breadcrumbs = array();
      while ($parent_id) {
        $page = get_page($parent_id);
        $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
        $parent_id  = $page->post_parent;
      }
      $breadcrumbs = array_reverse($breadcrumbs);
      for ($i = 0; $i < count($breadcrumbs); $i++) {
        echo $breadcrumbs[$i];
        if ($i != count($breadcrumbs)-1) echo ' ' . $delimiter . ' ';
      }
      if ($showCurrent == 1) echo ' ' . $delimiter . ' ' . $before . get_the_title() . $after;
 
    } elseif ( is_tag() ) {
      echo $before . 'Posts tagged "' . single_tag_title('', false) . '"' . $after;
 
    } elseif ( is_author() ) {
       global $author;
      $userdata = get_userdata($author);
      echo $before . 'Articles posted by ' . $userdata->display_name . $after;
 
    } elseif ( is_404() ) {
      echo $before . 'Error 404' . $after;
    }
 
    if ( get_query_var('paged') ) {
      if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' (';
      echo __('Page') . ' ' . get_query_var('paged');
      if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
    }
 
    echo '</div>';
 
  }
} // end the_breadcrumb()

//// BREADCRUMB END ////
//paste this line of code in html file that set
<?php if (function_exists('the_breadcrumb')) the_breadcrumb(); ?>

Featured Post

Make money online

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

Popular Posts