VickyTFC
Forum Replies Created
-
Forum: Plugins
In reply to: [AntiVirus] AlertsToo easy, many thanks for your help Torsten!
Forum: Plugins
In reply to: [WooCommerce] Product Image Thumbnail to External Link in New TabI ended up finding some code that enables the image to open in a new tab. The title still doesn’t, but that’s okay. 1 out of 2 isn’t too bad and the image was the most needed.
Thank you to both of you for you help!
Regards, Vicky
Forum: Plugins
In reply to: [WooCommerce] Product Image Thumbnail to External Link in New TabHi @rynald0s
That didn’t work either unfortunately.
Am I inserting it correctly:
<?php
/*
* Here we have all the custom functions for the theme
* Please be extremely cautious editing this file.
* You have been warned!
*
*/
add_action( ‘template_redirect’, ‘redirect_external_products’ );
function redirect_external_products() {
global $post;
if ( is_singular( ‘product’ ) && ! empty( $post ) && ( $product = wc_get_product( $post ) ) && $product->is_type( ‘external’ ) ) {
wp_redirect( $product->get_product_url() );
exit;
}
}
add_filter( ‘woocommerce_get_catalog_ordering_args’, ‘wcs_get_catalog_ordering_args’ );
function wcs_get_catalog_ordering_args( $args ) {$orderby_value = isset( $_GET[‘orderby’] ) ? woocommerce_clean( $_GET[‘orderby’] ) : apply_filters( ‘woocommerce_default_catalog_orderby’, get_option( ‘woocommerce_default_catalog_orderby’ ) );
if ( ‘on_sale’ == $orderby_value ) {$args[‘orderby’] = ‘meta_value_num’;
$args[‘order’] = ‘DESC’;
$args[‘meta_key’] = ‘_sale_price’;}
return $args;}
add_filter( ‘woocommerce_default_catalog_orderby_options’, ‘wcs_catalog_orderby’ );
add_filter( ‘woocommerce_catalog_orderby’, ‘wcs_catalog_orderby’ );
function wcs_catalog_orderby( $sortby ) {$sortby[‘on_sale’] = ‘On Sale’;
return $sortby;}
remove_action( ‘woocommerce_before_shop_loop_item’,’woocommerce_template_loop_product_link_open’, 10 );
add_action ( ‘woocommerce_before_shop_loop_item’, ‘wct_function_open_new_tab’, 10 );
function wct_function_open_new_tab() {
echo ‘‘;
}
// Option-Tree Theme Mode.
require get_theme_file_path( ‘/inc/admin/option-tree/init.php’ );// Mobile Detect.
require get_theme_file_path( ‘/inc/framework/thb-mobile-detect.php’ );// Theme Admin.
require get_theme_file_path( ‘/inc/admin/welcome/fuelthemes.php’ );// TGM Plugin Activation Class.
require get_theme_file_path( ‘/inc/admin/plugins/plugins.php’ );// Imports.
require get_theme_file_path( ‘/inc/admin/imports/import.php’ );// Social Links.
require get_theme_file_path( ‘/inc/framework/thb-social-links/social-links.php’ );// Script Calls.
require get_theme_file_path( ‘/inc/script-calls.php’ );// Ajax.
require get_theme_file_path( ‘/inc/ajax.php’ );// Add Menu Support.
require get_theme_file_path( ‘/inc/wp3menu.php’ );// Lazy Loading.
require get_theme_file_path( ‘/inc/framework/thb-lazyload.php’ );// Enable Sidebars.
require get_theme_file_path( ‘/inc/sidebar.php’ );// Post Grids.
require get_theme_file_path( ‘/inc/post-grids.php’ );// Widgets.
require get_theme_file_path( ‘/inc/widgets.php’ );// Social Functions.
require get_theme_file_path( ‘/inc/framework/thb-instagram.php’ );
require get_theme_file_path( ‘/inc/framework/thb-social-shares/social-share-count.php’ );
require get_theme_file_path( ‘/inc/post-social.php’ );// Misc.
require get_theme_file_path( ‘/inc/misc.php’ );// Category Settings.
require get_theme_file_path( ‘/inc/framework/thb-category-settings.php’ );// Reviews.
require get_theme_file_path( ‘/inc/post-reviews.php’ );// CSS Output of Theme Options.
require get_theme_file_path( ‘/inc/selection.php’ );// Twitter.
require get_theme_file_path( ‘/inc/framework/thb-twitter-helper.php’ );// Visual Composer Integration.
require get_theme_file_path( ‘/inc/framework/visualcomposer/visualcomposer.php’ );// WooCommerce Settings specific for theme.
require get_theme_file_path( ‘/inc/woocommerce.php’ );
require get_theme_file_path( ‘/inc/woocommerce-category-image.php’ );// Advertisements.
require get_theme_file_path( ‘/inc/advertisement.php’ );// SideKick Integration.
define( ‘SK_PRODUCT_ID’, 459 );
define( ‘SK_ENVATO_PARTNER’, ‘5LXnCIbjT0TD4jcyZuhMSAgVwil8hU5TTxIW5cNNwbA=’ );
define( ‘SK_ENVATO_SECRET’, ‘RqjBt/YyaTOjDq+lKLWhL10sFCMCJciT9SPUKLBBmso=’ );// Tribe Events Compatibility.
add_action( ‘tribe_events_before_html’, function() {
echo ‘<div class=”row”><div class=”small-12 columns”>’;
});
add_action( ‘tribe_events_after_html’, function() {
echo ‘</div></div>’;
});Forum: Plugins
In reply to: [WooCommerce] Product Image Thumbnail to External Link in New TabHi @jricketts4
That didn’t work either, unfortunately. At least it didn’t crash the site this time though:)
See this page for results: https://thefashioncatalyst.com/shop/womens/clothing/
The ‘Shop Now’ button works perfectly by opening in a new tab. But the thumbnail and product title don’t open in a new tab.
I actually wouldn’t mind if the thumbnail and product title had no option to be clicked on. And therefore, the ‘Shop Now’ button just becomes the only option.
If you have the latter workaround, that would be equally as great:)
Regardless, thank you for your help!
Forum: Plugins
In reply to: [WooCommerce] Product Image Thumbnail to External Link in New TabHey @jricketts4
I don’t know how to upload a screenshot here. Sorry (lol).
Below is functions.php code, if you wanted to insert it as it’s meant to sit then I can copy/paste it in:
<?php
/*
* Here we have all the custom functions for the theme
* Please be extremely cautious editing this file.
* You have been warned!
*
*/
add_action( ‘template_redirect’, ‘redirect_external_products’ );
function redirect_external_products() {
global $post;
if ( is_singular( ‘product’ ) && ! empty( $post ) && ( $product = wc_get_product( $post ) ) && $product->is_type( ‘external’ ) ) {
wp_redirect( $product->get_product_url() );
exit;
}
}
add_filter( ‘woocommerce_get_catalog_ordering_args’, ‘wcs_get_catalog_ordering_args’ );
function wcs_get_catalog_ordering_args( $args ) {$orderby_value = isset( $_GET[‘orderby’] ) ? woocommerce_clean( $_GET[‘orderby’] ) : apply_filters( ‘woocommerce_default_catalog_orderby’, get_option( ‘woocommerce_default_catalog_orderby’ ) );
if ( ‘on_sale’ == $orderby_value ) {$args[‘orderby’] = ‘meta_value_num’;
$args[‘order’] = ‘DESC’;
$args[‘meta_key’] = ‘_sale_price’;}
return $args;}
add_filter( ‘woocommerce_default_catalog_orderby_options’, ‘wcs_catalog_orderby’ );
add_filter( ‘woocommerce_catalog_orderby’, ‘wcs_catalog_orderby’ );
function wcs_catalog_orderby( $sortby ) {$sortby[‘on_sale’] = ‘On Sale’;
return $sortby;}
// Option-Tree Theme Mode.
require get_theme_file_path( ‘/inc/admin/option-tree/init.php’ );// Mobile Detect.
require get_theme_file_path( ‘/inc/framework/thb-mobile-detect.php’ );// Theme Admin.
require get_theme_file_path( ‘/inc/admin/welcome/fuelthemes.php’ );// TGM Plugin Activation Class.
require get_theme_file_path( ‘/inc/admin/plugins/plugins.php’ );// Imports.
require get_theme_file_path( ‘/inc/admin/imports/import.php’ );// Social Links.
require get_theme_file_path( ‘/inc/framework/thb-social-links/social-links.php’ );// Script Calls.
require get_theme_file_path( ‘/inc/script-calls.php’ );// Ajax.
require get_theme_file_path( ‘/inc/ajax.php’ );// Add Menu Support.
require get_theme_file_path( ‘/inc/wp3menu.php’ );// Lazy Loading.
require get_theme_file_path( ‘/inc/framework/thb-lazyload.php’ );// Enable Sidebars.
require get_theme_file_path( ‘/inc/sidebar.php’ );// Post Grids.
require get_theme_file_path( ‘/inc/post-grids.php’ );// Widgets.
require get_theme_file_path( ‘/inc/widgets.php’ );// Social Functions.
require get_theme_file_path( ‘/inc/framework/thb-instagram.php’ );
require get_theme_file_path( ‘/inc/framework/thb-social-shares/social-share-count.php’ );
require get_theme_file_path( ‘/inc/post-social.php’ );// Misc.
require get_theme_file_path( ‘/inc/misc.php’ );// Category Settings.
require get_theme_file_path( ‘/inc/framework/thb-category-settings.php’ );// Reviews.
require get_theme_file_path( ‘/inc/post-reviews.php’ );// CSS Output of Theme Options.
require get_theme_file_path( ‘/inc/selection.php’ );// Twitter.
require get_theme_file_path( ‘/inc/framework/thb-twitter-helper.php’ );// Visual Composer Integration.
require get_theme_file_path( ‘/inc/framework/visualcomposer/visualcomposer.php’ );// WooCommerce Settings specific for theme.
require get_theme_file_path( ‘/inc/woocommerce.php’ );
require get_theme_file_path( ‘/inc/woocommerce-category-image.php’ );// Advertisements.
require get_theme_file_path( ‘/inc/advertisement.php’ );// SideKick Integration.
define( ‘SK_PRODUCT_ID’, 459 );
define( ‘SK_ENVATO_PARTNER’, ‘5LXnCIbjT0TD4jcyZuhMSAgVwil8hU5TTxIW5cNNwbA=’ );
define( ‘SK_ENVATO_SECRET’, ‘RqjBt/YyaTOjDq+lKLWhL10sFCMCJciT9SPUKLBBmso=’ );// Tribe Events Compatibility.
add_action( ‘tribe_events_before_html’, function() {
echo ‘<div class=”row”><div class=”small-12 columns”>’;
});
add_action( ‘tribe_events_after_html’, function() {
echo ‘</div></div>’;
});Forum: Plugins
In reply to: [WooCommerce] Product Image Thumbnail to External Link in New TabHi @jricketts4
Thanks for your reply. Unfortunately, it didn’t work ??
I tried putting it at the bottom of the functions.php file and that crashed the website. I tried again at the top, and that didn’t change the product to open in a new tab.
Thanks, Vicky
Forum: Plugins
In reply to: [WooCommerce] Product Image Thumbnail to External Link in New TabI have that plugin installed and active already. Though it only creates a new tab for the ‘Buy Now’ button (or in my case, ‘Shop Now’ button) and not the thumbnail image.
Therefore, I require just someone to advise of where I place the ” target=”_blank” html code in the code that I pasted in my original message.
Thanks, Vicky
Forum: Plugins
In reply to: [WooCommerce] External URL On Product ImagesOMG! Thank you SOOO very much, @yukikatayama You’re a star!
That code worked a treat (just need to figure out how to get it to open in a new window instead of the same window – I have asked in that forum thread so hopefully I receive a response soon).
THANK YOU SOOO MUCH – you’ve made my year! Xv
Forum: Plugins
In reply to: [WooCommerce] External URL On Product ImagesTo give my request for code a little more context, here is an example of a website that links exactly as I would like:
https://www.shopstyle.com/browse/womens-shoes
As like me, they’re an affiliate website. And it makes the best sense for products to link directly to the source as opposed to having the user click through various pages first to land on the product. As you know yourself, you just click away to a different option if there are too many pages to go through.
Forum: Plugins
In reply to: [WooCommerce] External URL On Product ImagesThanks for your reply & plugin suggestion, @yukikatayama
I already have over 30 plugins on the site and actively trying to get the site to better perform speed-wise. So unfortunately another plugin is not really an option.
The best option is to input the code.
Thanks @mihaiimagely – looks like it’s working again now:) Perhaps it started working after another plugin update.
Many thanks!
Forum: Plugins
In reply to: [AMP] Installation HelpThanks for your reply @swissspidy
I went ahead and switched it to Standard mode as advised and it put a large X at the top of my homepage and completely miffed the appearance of it. Along with returning 15 error types on the homepage. Hence deactivating the plugin now.
I think I need to read more about it because I have very limited knowledge as to what the benefits are. And unfortunately I couldn’t see any benefits from having it activated during the last 10 days (only the fact that it went from 27 errors to 211 now and the average position of the site went backwards).
I came across the plugin because I did a speed test and google recommended it to get better speed. However, being that I fall into the “site owner” category with beginner “implementor” skills, I thought it would be similar to most other plugins whereby I click activate and the preexisting settings automatically set to make it work most efficiently for the site. Sadly that wasn’t the case.
That being said, if Google is recommending it for my site, then I’m clearly missing the know-how.
Any suggestions on how I can get up to speed with it please? pun intended:)
My intentions are to complete my site clean – which could take another 7 days or more. Thereafter I want to activate the AMP plugin again to optimise the site as best I can. And the aim being to speed up my site and get better ranked once again.
Many thanks for all your help, Vicky
Forum: Plugins
In reply to: [AMP] Installation HelpOh, can anyone tell me why I now have /amp/ at the end of our urls now too please? For example:
https://thefashioncatalyst.com/product/ghd-gold-styler-ghd-official-website/amp/
This url is UGLY so I’m hoping it’s not actively utilised.
Forum: Plugins
In reply to: [AMP] Installation HelpThanks @westonruter ??
And thank you @optimizingmatters – you’re always great in the forums! I’ve disabled lazyload. Will that also fix the JS issue? Or do I need to do something further.
Many thanks, Vicky
Forum: Plugins
In reply to: [AMP] Installation HelpHi @jamesosborne The GSC results aren’t stale (as at 22 Sept). You suggest even more plugins to solve the AMP plugin issues. I find it hard to get my head around all these plugins just to run 1 plugin that I thought would just work. I already have 40+ plugins so I’m hesitant to keep downloading plugins to make the others work.
- This reply was modified 5 years, 2 months ago by VickyTFC.