Friday, 12 May 2017

Featured Image Get in Wordpress

<?php
if(is_home()){
   $blog_page = get_option( 'page_for_posts' );
   $src = wp_get_attachment_image_src( get_post_thumbnail_id($blog_page), 'full' );
$Featured_Image = 'style="background-image: url('.$src[0].');"';
}
?>
<div class="" <?php echo $Featured_Image; ?>></div>

Tuesday, 3 January 2017

WooCommerce: Add wordpress custom field Tab on the Product Page

<?php

/* ## WooCommerce: Add wordpress custom field Tab on the Product Page ## */

/*--------------- Add belove code in theme's function.php file --------------*/



/* Add custom field description tab in Product page */

add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );

function woo_new_product_tab( $tabs ) {
   
$tabs['product_short_description'] = array(
    'title'     => __( 'Ingredients', 'woocommerce' ),
    'priority'  => 50,
    'callback'  => 'woo_new_product_tab_content'
);
    return $tabs;
}


function woo_new_product_tab_content() {
echo get_post_meta(get_the_ID(), 'custom_field_name', TRUE); // Add here custom field name
}

/*. Add custom field description tab in Product page */
?>

Monday, 12 December 2016

SSL certificate problem: unable to get local issuer certificate in Wordpress Update

Wordpress in Plugins or Wordpress version issue by

SSL certificate problem: unable to get local issuer certificate


Resolved:
Add belove two lina at bouttom in "wp-config.php" file

add_filter('https_ssl_verify', '__return_false');
add_filter('https_local_ssl_verify', '__return_false');

Friday, 29 July 2016

How to Merge Multiple .sql Tables/files Into a Single File?

1. Goto cmd

2. Type in command prompt
C:\users\Usersname>cd [.sql tables folder path ]
Press Enter
Ex: C:\users\Usersname>cd E:\project\database

3. Type command prompt
C:\users\Usersname>[.sql folder's drive (directory)name]
Press Enter
Ex: C:\users\Usersname>E:

4. Type command prompt for marge all .sql file(table) in a single file
copy /b *.sql newdatabase.sql
Press Enter
EX: E:\project\database>copy /b *.sql newdatabase.sql

5. You can see Merge Multiple .sql(file) tables Files Into A Single File in your directory folder
Ex: E:\project\database

Friday, 24 June 2016

How to add external link in target and class

<head>
    <script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script type='text/javascript'>
$( document ).ready(function() {

  $('a').filter(function() {
  return this.hostname && this.hostname !== location.hostname;
}).attr('target', '_blank');

  $('a').filter(function() {
  return this.hostname && this.hostname !== location.hostname;
}).addClass("external");

});
    </script>
</head>