bencross02
Forum Replies Created
-
Hi Fotis –
I’ve re-enabled infinite scroll on the main site: https://indiegamereviewer.com/
I’ve gone through all the plugins on the site to test conflicts and wasn’t able to get the infinite scroll working.
The staging site has the exact same theme and is still working with no issues: https://bencross.co/igr/
Any help you can offer is appreciated. I would love to be able to use this feature!
Thanks again!
Hello Fotis and thanks for the reply.
I’ve tested the infinite scroll with the default ‘_s’ jetpack support enabled and it works fine, just displays a different template.
Strange that it’s not working for you on bencross.co/igr
I just checked it on Chrome, Firefox, Edge and IE 11 on my Windows 10 laptop and checked Chrome and Firefox on Android and Infinite Scroll is working as expected.
I’ve implemented pagination on the main site (indiegamereviewer.com) because I need that older content available to users, but I can’t replicate the broken Infinite Scroll on any other instance of this site.
Any suggestions of how to get this working everywhere?
Thanks again for your help!
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Updated to 4.0.8 and search returns nothingThose categories were excluded in the restriction settings. Once I unchecked them everything started working again!
Thanks for your help!
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Updated to 4.0.8 and search returns nothingThanks for the quick reply!
Here are the results from the different debugging steps that I am getting. I am using the search term “Chanel’, there are six or seven products that have that word in their title.
“Look at the parameters Relevanssi is getting”
array(68) { ["s"]=> string(6) "Chanel" ["error"]=> string(0) "" ["m"]=> string(0) "" ["p"]=> int(0) ["post_parent"]=> string(0) "" ["subpost"]=> string(0) "" ["subpost_id"]=> string(0) "" ["attachment"]=> string(0) "" ["attachment_id"]=> int(0) ["name"]=> string(0) "" ["static"]=> string(0) "" ["pagename"]=> string(0) "" ["page_id"]=> int(0) ["second"]=> string(0) "" ["minute"]=> string(0) "" ["hour"]=> string(0) "" ["day"]=> int(0) ["monthnum"]=> int(0) ["year"]=> int(0) ["w"]=> int(0) ["category_name"]=> string(0) "" ["tag"]=> string(0) "" ["cat"]=> string(0) "" ["tag_id"]=> string(0) "" ["author"]=> string(0) "" ["author_name"]=> string(0) "" ["feed"]=> string(0) "" ["tb"]=> string(0) "" ["paged"]=> int(0) ["meta_key"]=> string(0) "" ["meta_value"]=> string(0) "" ["preview"]=> string(0) "" ["sentence"]=> string(0) "" ["title"]=> string(0) "" ["fields"]=> string(0) "" ["menu_order"]=> string(0) "" ["embed"]=> string(0) "" ["category__in"]=> array(0) { } ["category__not_in"]=> array(0) { } ["category__and"]=> array(0) { } ["post__in"]=> array(0) { } ["post__not_in"]=> array(0) { } ["post_name__in"]=> array(0) { } ["tag__in"]=> array(0) { } ["tag__not_in"]=> array(0) { } ["tag__and"]=> array(0) { } ["tag_slug__in"]=> array(0) { } ["tag_slug__and"]=> array(0) { } ["post_parent__in"]=> array(0) { } ["post_parent__not_in"]=> array(0) { } ["author__in"]=> array(0) { } ["author__not_in"]=> array(0) { } ["orderby"]=> string(10) "menu_order" ["order"]=> string(3) "ASC" ["ignore_sticky_posts"]=> bool(false) ["suppress_filters"]=> bool(false) ["cache_results"]=> bool(true) ["update_post_term_cache"]=> bool(true) ["lazy_load_term_meta"]=> bool(true) ["update_post_meta_cache"]=> bool(true) ["post_type"]=> string(3) "any" ["posts_per_page"]=> int(12) ["nopaging"]=> bool(false) ["comments_per_page"]=> string(2) "50" ["no_found_rows"]=> bool(false) ["search_terms_count"]=> int(1) ["search_terms"]=> array(1) { [0]=> string(6) "Chanel" } ["search_orderby_title"]=> array(1) { [0]=> string(166) "wil_posts.post_title LIKE '{4c2db7187c3de51d936da28fc50d68636248889d188ce8958ce8a1f1acf26a2a}Chanel{4c2db7187c3de51d936da28fc50d68636248889d188ce8958ce8a1f1acf26a2a}'" } }
“Look at the MySQL query”
string(729) "SELECT DISTINCT(relevanssi.doc), relevanssi.*, relevanssi.title * 5 + relevanssi.content * 10 + relevanssi.comment * 0 + relevanssi.tag * 5 + relevanssi.link * 0 + relevanssi.author + relevanssi.category * 5 + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf FROM wil_relevanssi AS relevanssi WHERE (relevanssi.term LIKE 'chanel%' OR relevanssi.term_reverse LIKE CONCAT(REVERSE('chanel'), '%')) AND relevanssi.doc IN (SELECT DISTINCT(tr.object_id) FROM wil_term_relationships AS tr WHERE tr.term_taxonomy_id IN (1,19,20,21)) AND relevanssi.doc NOT IN (SELECT DISTINCT(tr.object_id) FROM wil_term_relationships AS tr WHERE tr.term_taxonomy_id IN (1,19,20,21))"
“Look at the results”
array(0) { }
I ran these tests on the live site. The other plugins I’m running are:
JetPack 6.0
Meta Box 4.14.5
Simple Custom Post Order 2.3.2
WooCommerce 3.3.5These are the most recent updated versions of these plugins and all of them had been running alongside your plugin for the last couple of years with no issues whatsoever.
As I mentioned in my previous post. I’ve tried deactivating all of these plugins and still have the same issues with the search.
I am using a custom theme built off of ‘_s’ (https://github.com/Automattic/_s)
Any help you can offer to help resolve this would be appreciated.
Thanks!
- This reply was modified 6 years, 11 months ago by bencross02.
I’m just using the default WooCommerce content-product.php file.
The only change I made was to the ‘loop_shop_columns’ part under “// Store column count for displaying the grid”. I made it 8 instead of 4 so I could show the repeating content together in one screen shot.
Thanks again!
<?php /** * The template for displaying product content within loops. * * Override this template by copying it to yourtheme/woocommerce/content-product.php * * @author WooThemes * @package WooCommerce/Templates * @version 2.4.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } global $product, $woocommerce_loop; // Store loop count we're currently on if ( empty( $woocommerce_loop['loop'] ) ) { $woocommerce_loop['loop'] = 0; } // Store column count for displaying the grid if ( empty( $woocommerce_loop['columns'] ) ) { $woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', 8 ); } // Ensure visibility if ( ! $product || ! $product->is_visible() ) { return; } // Increase loop count $woocommerce_loop['loop']++; // Extra post classes $classes = array(); if ( 0 == ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns'] ) { $classes[] = 'first'; } if ( 0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns'] ) { $classes[] = 'last'; } ?> <li <?php post_class( $classes ); ?>> <?php do_action( 'woocommerce_before_shop_loop_item' ); ?> <a href="<?php the_permalink(); ?>"> <?php /** * woocommerce_before_shop_loop_item_title hook * * @hooked woocommerce_show_product_loop_sale_flash - 10 * @hooked woocommerce_template_loop_product_thumbnail - 10 */ do_action( 'woocommerce_before_shop_loop_item_title' ); /** * woocommerce_shop_loop_item_title hook * * @hooked woocommerce_template_loop_product_title - 10 */ do_action( 'woocommerce_shop_loop_item_title' ); /** * woocommerce_after_shop_loop_item_title hook * * @hooked woocommerce_template_loop_rating - 5 * @hooked woocommerce_template_loop_price - 10 */ do_action( 'woocommerce_after_shop_loop_item_title' ); ?> </a> <?php /** * woocommerce_after_shop_loop_item hook * * @hooked woocommerce_template_loop_add_to_cart - 10 */ do_action( 'woocommerce_after_shop_loop_item' ); ?> </li>
Thanks for the reply Jeremy. I tried the suggestions you mentioned but to no avail.
I am not using the traditional “shop” page at all, instead using the permalink shop base option. https://www.weidmangallery.com is the website. When I switched to “is_shop()” it stops loading the woocommerce template.
Currently I am using the Infinite Scroll plugin but since it is not being actively developed I figured it was probably a better idea to use the built in features of Jetpack.
With all that said here is a the code that I am now using.
/** * Jetpack setup function. * * See: https://jetpack.me/support/infinite-scroll/ * See: https://jetpack.me/support/responsive-videos/ */ function wg_jetpack_setup() { // Add theme support for Infinite Scroll. add_theme_support( 'infinite-scroll', array( 'container' => 'content', 'render' => 'wg_infinite_scroll_render', 'footer' => 'page', 'posts_per_page' => 8, ) ); // Add theme support for Responsive Videos. add_theme_support( 'jetpack-responsive-videos' ); } // end function wg_jetpack_setup add_action( 'after_setup_theme', 'wg_jetpack_setup' ); /** * Custom render function for Infinite Scroll. */ function wg_infinite_scroll_render() { while ( have_posts() ) { the_post(); if ( is_search() ) { get_template_part( 'template-parts/content', 'search' ); } elseif ( is_woocommerce() ) { wc_get_template_part( 'content', 'product' ); } else { get_template_part( 'template-parts/content', get_post_format() ); } } } // end function wg_infinite_scroll_render
This causes the first set of products to be duplicated. See screenshot here: https://www.weidmangallery.com/screenshot.png
the second row is loaded by the Jetpack Infinite Scroll. That’s why I was trying to offset the posts. I just don’t know how to add that to the custom render function that’s calling the different templates.
Any suggestions?
Thanks again for your help.
Forum: Plugins
In reply to: [Meta Box] image advancedOkay, so I figured this out if anyone comes across this. here is the code that worked:
$images = rwmb_meta( 'mysite_ingadv', 'type=image_advanced&size=full' ); foreach ( $images as $image ) { echo "<img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' />"; }
The size parameter uses the default wordpress media sizing from the media settings panel, make sure to include a size or it will be the default wordrpess thumbnail size you have defined in your settings.
Forum: Plugins
In reply to: [Meta Box] image advancedSorry, just realized the code I posted was wrong. I’m still getting the same error with this code though:
<?php rwmb_meta( 'mysite_imgadv', $args = array( 'type' => 'image_advanced', ) ); ?> <a href="<?php the_permalink(); ?>" rel="bookmark"> <?php echo rwmb_meta( 'mysite_imgadv', $args ); ?> </a>
Any help is really appreciated.
Thanks
BC