Skip to main content

Posts

Showing posts with the label WordPress

Install Google Analytics to WordPress Without a Plugin

  Install Google Analytics to WordPress Without a Plugin In order for Google Analytics to start tracking your visitors, the tracking code mentioned above needs to be present on every page of your site you want to track user behavior on. Usually, that’s all of them. Here’s how you can achieve that manually. Option A: Insert the Code Into  header.php One of the main ways to add the tracking code to your site is to insert it into your header. This way, it will load on every page. Most standard themes have a header.php file that is responsible for outputting the site header section. So, you can simply input the Google Analytics code here. However, when you make changes to theme files, be aware that it’s always best to do it in a child theme. Otherwise, they will get lost when you update your main theme. Child themes are super useful in general and you should definitely read up about them. Also, don’t forget to back up your WordPress site when making any changes like this. Once you...

svg file not upload in wordpress

Cannot upload SVG files in WordPress When we upload the SVG file, we recieve the notification  “Sorry, this file type is not permitted for security reasons.” To Resolve this issue, we need to add the below function in the functions.php files function cc_mime_types($mimes) { $mimes['svg'] = 'image/svg+xml'; return $mimes; } add_filter('upload_mimes', 'cc_mime_types'); This will resolve the issue.

Wordpress, Gravity form - Remove space between currency symbol and amount

Wordpress, Gravity form - Remove space between currency symbol and amount Remove space between currency symbol and amount Please use the below WordPress in the theme Function (functions.php) file add_filter('gform_currencies', 'update_currency'); function update_currency($currencies) {     $currencies['GBP'] = array(         'name' => __('Pound', 'gravityforms'),         'symbol_left' => '£',         'symbol_right' => '',         'symbol_padding' => '',         'thousand_separator' => ',',         'decimal_separator' => '.',         'decimals' => 2);     return $currencies; } Change Currency symbol from left to right Please use the below WordPress in the theme Function (functions.php) file: add_filter('gform_currencies', 'update_currency'); function update...

Wordpress Yoast, Change breadcrumb trail from post to page

WordPress Yoast, Change breadcrumb trail from  to page Please use the below WordPress in the theme Function (functions.php) file add_filter('wpseo_breadcrumb_links', 'wpse_post_breadcrumbs'); // $links are the current breadcrumbs function wpse_post_breadcrumbs($links) {     // Use is_singular($post_type) to identify a single CPT     // This assumes your CPT is called "post" - change it as needed  if(is_singular('post')) {         // The first item in $links ($links[0]) is Home, so skip it         // The second item in $links is Projects - we want to change that         $links[1] = array('text' => 'News', 'url' => '/news/', 'allow_html' => 1);     }     // Even if we didn't change anything, always return the breadcrumbs     return $links; }

Wordpress, Gravity form - GFCommon::encrypt() is deprecated since version 2.3! Use GFCommon::openssl_encrypt() instead.

After updating  the gravity form ,I’m receiving a few error messages: Notice : GFCommon::encrypt() is deprecated since version 2.3! Use GFCommon::openssl_encrypt() instead. in /home4/sunshine/public_html/wp-includes/functions.php on line 4435 Deprecated : Function mcrypt_get_iv_size() is deprecated in /home4/sunshine/public_html/wp-content/plugins/gravityforms/common.php on line 5399 Deprecated : Function mcrypt_create_iv() is deprecated in /home4/sunshine/public_html/wp-content/plugins/gravityforms/common.php on line 5402 Deprecated : Function mcrypt_encrypt() is deprecated in /home4/sunshine/public_html/wp-content/plugins/gravityforms/common.php on line 5402 Solution -  That indicates the reCAPTCHA field is using the old stoken integration method. To upgrade it to use the newer integration method you need to generate new reCAPTCHA api keys for your site and add them to the Forms > Settings page. That should take care of it for you.

Wordpress - Contact Form 7 notification open in popup - Bootstrap modal popup

How to add open Contact form 7 Notification / Messages in Modal popup We can use the Bootstrap modal popup and Contact form 7 Doom Events to create the popup. Paste the below code in the functions.php, it will work for you (please change the messages as per the requirements): add_action('wp_footer', 'munesh_Footertext'); function munesh_Footertext() { echo '<div class="modal fade in formids" id="myModal2" role="dialog" tabindex="-1">     <div class="modal-dialog">       <!-- Modal content-->       <div class="modal-content no_pad text-center">          <button type="button" class="close" data-dismiss="modal">&times;</button>         <div class="modal-header heading">           <h3 class="modal-title" id="MSTitle">Message Sent!</b></h3>         </div>      ...

Contact Form 7 reCAPTCHA not showing

Contact Form 7 latest version not supporting the reCAPTCHA, So, We need to downgrade the Recaptcha plugin, Steps to Rollback the Contact Form 7 : Install the Plugin "wp rollback". After Installing go to the plugins, you will find an option below all the plugins for rollback. So, rollback the Contact Form 7  from 5.1 to 5.0.5 After this go to integration on the contact form and paste your keys again like you did in the beginning. Open your contact form on the backend and save it again. Make sure you add the recaptha again Now go to your front-end and refresh your page.And your done! Wait for next update with the fix. No need te install any other plugins.

WooCommerce Order Cancelled After Successful Payment: Unpaid Order Cancelled – Time Limit Reached

After upgrading to WooCommerce 2.0 and Above, you have experienced the issue  that all the purchased order changes to the “canceled” status.  In the admin area, all the orders appear as “canceled”  with the message “ Unpaid order canceled – time limit reached “. When this happens, you need manually change the statuses of all the canceled orders. The problem arises due to the Hold Stock feature in WooCommerce Inventory management. In this feature, you can set a certain period of time to hold the stock for an unpaid order. To Resolve the issue, Go to the admin side of your WordPress store, and navigate to   WooCommerce > Settings > Products > Inventory . From this page, you can see that the Hold Stock field is set to 60 minutes by default. If you are using WooCommerce stock management, you can disable this feature by leaving the field blank. Simply delete the value in the field and then save the changes.

Wordpress - How to revert to classic editor / old editor?

How to revert to classic editor / old editor? if you wants to move back to the old Classic Editor By WordPress Contributors, please install the Plugin https://wordpress.org/plugins/classic-editor/ Classic Editor is an official plugin maintained by the WordPress team that restores the previous (“classic”) WordPress editor and the “Edit Post” screen. It makes it possible to use plugins that extend that screen, add old-style meta boxes, or otherwise depend on the previous editor. This plugin also gives you an option to keep both Gutenberg and the Classic editor at the same time. You can configure this in the plugin’s settings. Simply go to the Settings » Writing page in your WordPress admin area. You will see the option to do this under “Classic editor settings”. Don’t forget to click on the save changes button to store your settings. You will now be able to see a new link under the Posts menu to create new posts using the classic editor. You will also be able to ed...

WordPress line break not Working

Many WordPress users struggle around this issue of WordPress line break not working. In this article, we discuss some of the possible ways to get around this issue. 1. Use empty classes in HTML Elements You can make WordPress assume that your HTML elements contain certain attributes. This can be done by Adding attributes to the HTML elements with the use of empty classes. For example: Avoid writing: <p> <br> <span> Instead, write: <p class=""> <br class=""> <span class=""> 2. Disable Autop formatting The  Autop() function  in WordPress auto formats the paragraphs. The WordPress line break not working is due to the presence of a filter called “wpautop”. The “wpautop” filter executes whenever the content of a blog post is rendered. We can easily use the  remove_filter function  to disable the  wpautop filter . In the functions.php file you need to add the following code: remove_filter ('the_conten...

How to Disable WordPress Admin Bar for All Users Except Administrators

Disable Admin Bar for All Users Except for Administrators Paste this code in your theme’s functions.php file add_action( 'after_setup_theme' , 'remove_admin_bar' ); function remove_admin_bar() { if (!current_user_can( 'administrator' ) && !is_admin()) {    show_admin_bar(false); } } Disable Admin Bar for All Users If you want to disable it for all users, then simply put use this code in your theme’s functions.php file add_action( 'after_setup_theme' , 'remove_admin_bar' ); function remove_admin_bar() {    show_admin_bar(false); }

Wordpress media library not loading images

WordPress media library not loading images or Images are not displaying the images: Main cause of this issue is the plugin conflict, so please deactivate the plugin one by one and check that your issue resolved or not. WordPress always update it's software to avoid or overcome issues and it is depreciating the old functions. but some of our plugin using these functions and create problem. So in that case please update the plugin if possible otherwise deactivate it .

Wordpress pagination 404 error "/page/2" - what to do?

The problem mainly arises because permalinks set to Custom Structure /%category%/%postname%/. I understand WordPress assumes "page" is a post from the category. That is totally normal behaviour. If you want to remove category base you will need to write some custom rewrite rules, not simple rules I must say. Configure category base to . (dot), put this code in the functions.php of your theme, or better in a plugin, and flush the rewrite rules (code from this post in Daily Web Kit): add_filter ( 'category_rewrite_rules' , 'vipx_filter_category_rewrite_rules' ); function vipx_filter_category_rewrite_rules ( $rules ) { $categories = get_categories ( array ( 'hide_empty' => false ) ); if ( is_array ( $categories ) && ! empty ( $categories ) ) { $slugs = array (); foreach ( $categories as $category ) { if ( is_object ( $category ) && ! is_wp_error ( $ca...