How to open woocommerce product links in new tab ?

How to open woocommerce product links in new tab ?

Hey there is always a question asked on many wordpress forums that how can we open a woocommerce product link in a new tab so that user can select other products as well rather than going back and forth again and again.

This is not an easy task to do for someone who is a designer and for a beginner wordpress developer or a client.

So i decided to come up with a solution using woocommerce hooks which is a standard way of doing any custom tweaks to woocommerce functionalities. 

Lets get started.

You just need to open your functions.php file and paste the below snippet into it.

I have used woocommerce_template_loop_product_link_open hook to achieve this and added target=”_blank” in the anchor tag which opens a link in new tab.

/* Open Products in New Tab Woocommerce-DevelopingSense */

remove_action( 'woocommerce_before_shop_loop_item','woocommerce_template_loop_product_link_open', 10 );
// add a hook to my custom function
add_action ( 'woocommerce_before_shop_loop_item', 'ami_function_open_new_tab', 10 );
function ami_function_open_new_tab() {
echo '<a target="_blank" href="' . get_the_permalink() . '" class="woocommerce-LoopProduct-link">';
}

This is a best way to do it rather than using jquery or javascript which bloats a website.

Thanks and if you need any assistance you can contact me here.

Do leave your valuable comments.

Problem Solved: upgrade.php?_wp_http_referer=%2Fwp-admin%2F

Problem Solved: upgrade.php?_wp_http_referer=%2Fwp-admin%2F

This is a very common issue which happens when WordPress was not successfully updated. If this happens, then the admin is not able to log into wordpress dashboard as it redirects to this url Problem Solved: upgrade.php?_wp_http_referer=%2Fwp-admin%2F .

Below are simple steps to fix this issue in 2 minutes.

  1. Open File manager through hosting account or using FTP.
  2. Go to the wordpress installation directory and under wp-content folder, rename plugins folder to plugins123.
  3. Then go to your website url and write /wp-admin after the url.

You will see the dialog as below:

Click on UPDATE WordPress Database and the problem will be solved.

Cheers and comment for any issues.

 

 

How to move a WordPress website ?

How to move a WordPress website ?

Moving a wordpress website is one of the common jobs in the freelance websites since many years.There are many blogs and tutorials explaining the process in detail either by video or by image presentation.

In this post, I will explain the basic steps to bear in mind while moving a wordpress website which are necessary to avoid any future problems.

  • Always take a full backup of the website and database to be moved so that in case you run into any problems there is always a way back saving your precious hard work.
  • Upload the files in the server.
  • Update the htaccess file.
  • If your current website is in the root of the main domain like for example it is as www.developingsense.com and it is to be moved to another domain for example www.thedeveloping.in, then there is no such need of updating the .htaccess file.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&amp;amp;amp;lt;/IfModule&amp;amp;amp;gt;
# END WordPress

 

But if your current website is in the root directory of the domain and it has to be moved in any other folder of another domain like www.thedeveloping.in/wordpress, then the .htaccess has to be updated.

 

#BEGIN WordPress
 RewriteEngine On
 RewriteBase /theme/
 RewriteRule ^index\.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /theme/index.php [L]
 # END WordPress 

 

  • Now upload the exported database file to the new hosting using phpmyadmin.Do not forget to change the wp-options table rows. There you have to update the new website url in two places saying site_url and home_url.
  • Now update the wp-config.php file in the root of the directory where wordpress is installed.Here you to write the new database name, hostname, username and password. This is where the database connection error occurs if it is not updated correctly.ik

Above are some of the basic steps we have to take care of while moving the wordpress website. Like we know, during migration many types of problems may occur due to different server configurations and thus never hesitate to follow up in the comments section below and i will be more than happy to help you out in that.

Any suggestions or mistakes found in this post reported will be appreciated.

Passion on HIGH