WordPress Tricks

Add additional tab in woocommerce single product page and show Advanced Custom field info as tab info


Here I am sharing you the code which will help to show an additional / extra tab in woocommerce single product page, and show Advanced Custom fields info in the description of that tab . Just change the field info and put it in your theme’s function.php and save it.

if(! function_exists('new_tab')){

add_filter('woocommerce_product_tabs','new_tab');

function new_tab($tabs){
$tabs['my_tab']=array(
"title"=> "Product Review",
 "priority"=> 35,
"callback" =>"tab_desc",
);
return $tabs;
}
function tab_desc(){
	global $product;
$id = $product->get_id();
echo  get_field('review',$id); ;
}


}

Feel free to do comments if you have any question.

WordPress Tricks

Show 4 Post, One in Left and 3 in right with featured image: In Elementor Builder


Mainly I created the shortcode to show 4 post as per the design above, One in left and Three in right based on the request of one of my client. He wanted to show 4 post in such manner in Elementor page builder plugins. You have to use [recent_posts] in Elementor shortcode module to show it.

The code is divided in 2 part. One for Functions.php and other for Style.css

Code for function.php

Continue reading “Show 4 Post, One in Left and 3 in right with featured image: In Elementor Builder”

WordPress Tricks

Map With Different location pins and mouse activity disabled


This is for advanced users, just shared the code. You can use it in your site by changing the Pin Location name and address. Applicable for wordpress, html and php based sites. Feel free to do comments if you have any question regarding this.

Continue reading “Map With Different location pins and mouse activity disabled”

WordPress Tricks

Create Custom Post type and Category (taxonomy) for your Yoga, Teaching, travel, portfolio ,booking or gym workout based site


Just paste the following Code in your theme’s function.php

In the following Code, I have created Instruction post type with Weeks taxonomy (category) for one of my client. He requested me to show his workout plan based on Week and Day basis. So Just change the Name of Post type and taxonomy and save it.

function instruction_post_type_register(){

register_post_type('instructions',array(

'label'=> 'Instructions',
'public' =>true
));
register_taxonomy('weeks','instructions',array(
'labels'=> array(
    'name'=>'Weeks',
    'add_new_item'=>'Add New Week',
    'parent_item'=> 'Parent Week'
    ),
'hierarchical'=>true

));
}
add_action('init','instruction_post_type_register');

Feel free to do comments if you need any sort of helps.

WordPress Tricks

TwentySeventeen Theme Sidebar in Static Homepage with Comments Form


The main requirement was, to show sidebar in static homepage in twentyseventeen theme with comments form. Check the screenshot

Solution

I have created a template,named Home Sidebar for twentyseventeen theme . I am sharing the template with you

Put this template in your twentyseventeen theme folder and use it to create page with sidebar and comments form.

Continue reading “TwentySeventeen Theme Sidebar in Static Homepage with Comments Form”

WordPress Tricks

Common CSS For GutenBerg Editor To modify Headers, blockquotes and titles


To change Font size, color and font family of BlockQuote in Gutenberg Editor

blockquote.wp-block-quote, blockquote, blockquote p {
    font-size: 23px !important;
    color: darkred !important;
    font-family: cursive !important;
    font-style: italic !important;
    text-transform: uppercase;
    line-height: 27px !important;
}

To change header ( say h5) font size, color, italic style, uppercase and more in Gutenberg Editor

.wp-block-column h5 {
    font-size: 20px !important;
    color: darkred;
    font-family: cursive;
    text-transform: uppercase;
    text-align: center;
    font-style: italic;
    border-bottom: 2px solid red;
}

In Single page if you want to change the Page Titl’e font size, color, uppercase , alignment in Gutenberg Editor ( applicable for single post too)

h1.entry-title {
    font-size: 27px;
    color: darkred !important;
    font-family: cursive !important;
    font-style: italic !important;
    text-transform: uppercase !important;
    text-align: center !important;
}

WordPress Tricks

Radiate By ThemeGrill : Modifications of Header, Footer, Sidebar, menus,titles and more


Radiate By ThemeGrill is a clean, creative and minimal personal blogging responsive WordPress theme. The theme has full width slider to highlight some of your unique posts and has featured pages section to tell more about you. Just focus on writing beautiful content and everything else will be handled by this theme in a simple manner.

Continue reading “Radiate By ThemeGrill : Modifications of Header, Footer, Sidebar, menus,titles and more”

WordPress Tricks

Missing field “review” “brand” “availability” “url” how i solved it for Woocommerce Products


Recently one of my client ask me to solve the issue which you are seeing in the screenshot. I searched a lot in internet and support forums and found woocommerce has some issue with structured data and I didn’t find any good plugins which can help me solving this.

As woocommerce is generating the structured data, to solve this issue I blocked the “application/ld+json” related code generating by woocommerce. Just do this steps.

  1. Login to dashboard
  2. Go to Plugins > Plugin Editor
  3. Select Woocommerce
Select Woocommerce

4. Go to \includes\class-wc-structured-data.php

5. Block this line (put // just before this line)

echo '<script type="application/ld+json">' . wc_esc_json( wp_json_encode( $data ), true ) . '</script>'; 

6. Now check again your page / product using this . Issue will not be showing now

https://search.google.com/structured-data/testing-tool

If You Have Any Better Solution Feel Free To Let Me Know In The Comments Section