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

Contact Form 7 Issues Tricks and Solution

Contact Form 7 Multi Step Form: Solution of Redirecting Different Form Based On Selection


Contact Form 7 Multi Step Form Redirect to Different Form Based on Selection

This Post is for advanced users. So if you are using Contact Form 7 and Contact Form 7 Multi Steps Form and want your form to go to or Redirect Different Form based on Radio button or Drop down or Checkbox selection, then this post can help you.

I have used Jquery and Ajax to solve this issue. If you have any Question, Please ask question in the comments section.

<script>

jQuery(document).ready(function(){
 jQuery('input[type="radio"][name="radio-20"]').bind('click',function(){
	var ompp= jQuery(this).val();
	 console.log(ompp);
  
  jQuery.ajax({
		url:"<?php echo admin_url('admin-ajax.php');?>",
		type:"GET",
		contentType: "application/x-www-form-urlencoded;charset=UTF-8",
		 
		data:{
			
    		action: 'stravyfuncajax23',
	 		radiovalue:ompp
		     },
	  success: function(responsea){
		  jQuery("#bm").html(responsea);
console.log(responsea);
if(responsea=="Build Muscle"){
document.addEventListener( 'wpcf7mailsent', function( event ) {
    if ( event.detail.contactFormId === "1719") { location.replace("http://example.com/build-muscle-form-page/");}}, false );
}
else{
document.addEventListener( 'wpcf7mailsent', function( event ) {
    if ( event.detail.contactFormId === "1719") { location.replace("http://example.com/lose-weight-form-page/");}}, false );
}

}
	
});

 });		


});

</script>
in Function.php

add_action('wp_ajax_stravyfuncajax23','searchbyom');
add_action('wp_ajax_nopriv_stravyfuncajax23','searchbyom');
function searchbyom(){
$searchword1= $_GET['radiovalue'] ; 

if($searchword1=="Build Muscle"){

 echo "Build Muscle";
}else
{
echo "Lose Weight";
}
die();
}
The Contact Form 7 Code i used

First Name:
[text your-name]

Last Name:
[text last-name]


What is your goal?
[radio radio-20 default:0 "Lose Weight" "Build Muscle"]

[submit "Continue Questionnaire"][multistep "2-5"]
 
 
<div id="bm"></div>
Web Development

Button Click and Website Color Change : Applicable for wordpress /HTML/PHP and other sites


If you want to create a website and want your visitor to view your site in dark mode or in different color, then this example is for you. I am sharing you the zip version of the example. Just download the zip and check the index.html file.

I have created the example with 2 style sheet. One for Light (white) version and another for Darker version. So, when you will visit the site for first time, it will be Light version and then if you click on the button, it will be darker version. Click Here To Download.

Button Click and Website Color Change

Uncategorized

Load Contact Form 7 Scripts only in Contact page to increase GTmetrix score


Few days ago one of my client ask me helping to increase GTmetrix score. While checking I found Contact Form 7 script is loading in homepage and it is hampering the score. Though the Hompage doesn’t have Contact Form to show. To increase the score, it was wise to load the Contact Form 7 script to load only in Contact Page.

To solve this issue I used this code which helps me the Contact Form 7 script not to load in Homepage, but only in Contact page where the form is used. Just use the code below in your theme’s function.php

Continue reading “Load Contact Form 7 Scripts only in Contact page to increase GTmetrix score”

WordPress Tricks

Theme for Crafters and Designers : Button 2 by Automattic. Modifications, support and Customization


Button 2 is a theme that’s as cute as its name. With detailed accents, featured images, and a soft color palette, Button 2 is perfect for crafters and designers. So, if you want to show your Craft and Design related work in a website, then this wordpress theme is for you. You can use it for free. You can see the Demo of Button2 theme.

Button 2 by Automattic Modifications support and customization css

Download Button2 Theme by Automattic Parent Theme

Download Button 2 by Automattic Child Theme

I have shared some css customization process of Button2 theme.You can use the codes i shared to give it a new look of your own. Also you can ask question regarding any issue you are facing in comments section.

Continue reading “Theme for Crafters and Designers : Button 2 by Automattic. Modifications, support and Customization”

WordPress Tricks

Show Another Website or Webpage in any of your HTML or WordPress Page without Iframe


website masking show a page into another webpage without iframe

Recently one of my client asked me to do the following
1. Client created a Webinar (thirdparty) and wanted to show that while going to his Website.
2. He requested to show that Webinar without Redirecting to that site but creating Mask
3. Below is the code which can be used to show any thirdparty Webinar or other pages in your own page.
4. Iframe is not used, Frameset is used

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Your Title </title>
</head>
 <frameset rows="100%,*" border="0">
<frame src="THE WEBPAGE URL YOU WANT TO SHOW" frameborder="0" />
<frame frameborder="0" noresize />
</frameset> 
</html>
WordPress Tricks

PopUp Modal Confirmation with Yes, No and Redirection: For WordPress and Others


Recently one of my client asked me to show a Age Restriction Popup while clicking on a specific menu item.  

So, the requirement was

  1. Visitor will click on Specific menu item ( say for  Product menu)
  2. Instead of going to that Product page, Visitor will see a Popup Modal
  3. In that Popup Modal Visitor will see “Are You Above 18 Years Old ? “
  4. If visitor Click on “Yes”,  then visitor will redirct to a Specific page or another URL

Here is the screenshot how the final Popup was looking

PopUp Modal Confirmation Yes No and Redirection

You can ask question regarding any issue you are facing in comments section.

Continue reading “PopUp Modal Confirmation with Yes, No and Redirection: For WordPress and Others”

WordPress Tricks

WordPress plugins : Adds bugs and fruit flies with javascript which walk on your page.



Adds bugs with javascript which walk on your page

Inspired by this script. I have converted that script in a small WordPress Plugins. So, if you want bugs and fruit flies walk on your page you can use that plugins. You can check the Demo.

Just install the plugins created by me, activate it and check the homepage.

If you enjoy the plugins. Please let me know in comments section.

🙂

Bugs and Fruit flies walking on your wordpress site.

WordPress Tricks

Luxury By Organic Themes: Theme for Luxury Brands, fashion,wedding, high end products, services and travel industries


A WordPress theme for luxury brands, fashion and just plain classy sites. Luxury By Organic Themes is a classy theme created to showcase the finer things in life, Luxury is perfect for high-end products and services, the fashion and wedding industries, travel blogs, and any site where an elegant presentation is a priority.

Luxury brand theme wordpress

You canc check Luxury theme Demo.

You can ask question regarding any issue you are facing in comments section.

Continue reading “Luxury By Organic Themes: Theme for Luxury Brands, fashion,wedding, high end products, services and travel industries”

Web Development

Click on Audio player button and Audio mp3 will start playing, Using html, jquery, css :Applicable for wordpress also.


Click on Audio Player button and audio mp3 will start playing using html css and jquery Applicable for wordpress too

Recently one of my client asked me to  solve an issue. Just before starting a paragraph he wanted to show a audio player button. While clicking that audio player button mp3 audio file will be playing.

You can download the package (HTML, CSS, Javascript and font files).

You can use this package for:

  1. For PHP sites
  2.  Wordpress Sites
  3. HTML Sites.

Message me in comments section if you need help implemeting it in wordpress or any other platforms.