Category: General

General Jquery & Javascript

display none using javascript

Either we can use show() and hide() functions for this: $(“#hide_id”).hide(); $(“#hide_id”).show(); Or using css in scripts: $(“#hide_id”).css(“display”, “none”); this id can be displayed using: $(“#hide_id”).css(“display”, “block”);

General

How to call tag manager code in infinite scroll website pages?

Infinite scrolling pages, means at the end of a page next page will be loaded. This is latest trends in websites now. Especially in news website. Here we added instruction to track these infinite page scroll analytics using google analytics. Here we creating an event to get google analytics details while page scrolls: Event name…

General

How to create a custom event in google tag manager

Here we creating an event to get google analytics details while page scrolls: Event name :Scrollview Variables :pageurl, pagetitle dataLayer.push({ ‘event’:’Scrollview’, ‘pageurl’:titleurl, ‘pagetitle’:title }); This should be called wherever you need to trigger the event, in this case while page scrolling. Using this variable and event we need to configure an event in google tag…

General

Datalayer.push in google tag manager

dataLayer.push({    }); dataLayer.push javascript snippet is used to push details to Google tag manager. We can create a event and variables required for this/ dataLayer.push({ ‘event’:’Scrollview’, ‘pageurl’:titleurl, ‘pagetitle’:title }); Here we creating  an event called “ScrollView” , pageurl and pagetitle are variables we need to push to tag manager. Using these variable and event we…

General

Google tag manager

Google tag manager is used to add tags used in the website. Eg: Analytics, Any other tracking code, etc.. We can provide all those data in a single console provided by the tag manager. https://tagmanager.google.com/ Here we need to create an account with our website details.  This is what is called “Work space” in tag…

General

How to remove extra line break from editor using search and repalce method

You need to set search mode as regular expression: Search for : [\r\n]{2,} replace with :\n

General

Restricting wordpress search only for specific post type

function search_filter($query) { if ($query->is_search) { $query->set(‘post_type’, ‘post’); // specify slug of post type instead of this ‘post’ } return $query; } add_filter(‘pre_get_posts’,’search_filter’);

General wordpress

Our own plugins

Plugin to upload image in widgets: Download plugin from below link: widget-media-upload WordPress plugin to list woocommerce taxonomies with images. First of all set image uploading plugin to categories. We have used plugin: “Category images”: https://wordpress.org/plugins/categories-images/ Then we can choose the categories from the widget and show anywhere in the website with sidebars. Plugin :…

Load More