linux4me2
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Hidden products will appear in the search resultsHi @kateeba,
There is more than one way:
- You can use the WooCommerce Product Search widget (hidden products don’t appear) instead of the default WP search widget (hidden products appear) if all you need to do is search products.
- You can install the plugin you mentioned.
- You can install Relevanssi, use the default WP search widget to allow for searching all content, including products, and configure it as noted above to hide hidden products from search results.
Those are the options I’m aware of.
Forum: Reviews
In reply to: [HTML Plus Recent Posts by Category Widget] i love thisThanks for the kind words @csurga, but as you can see in the “Note” in the plugin description:
With the introduction of Widget Blocks in WordPress 5.8, this plugin is no longer necessary. The same results can be obtained by using a Widget Group, Heading Block, Custom HTML Block, and the Latest Posts Block. The latter also allows the use of multiple categories, which is not available with this plugin. Unless something major happens to change things, I won’t be developing the plugin beyond the current version (2.0.0).
I’m glad you like the plugin, but I recommend going with using the WP 5.8 method above since I will no longer be updating this plugin.
Forum: Plugins
In reply to: [WooCommerce] Hidden products will appear in the search resultsThat is very helpful information! I admit it has been a long time since I looked at this, and I couldn’t recall which search block the site uses, so I checked out our settings and did a little testing.
I can’t speak for @kateeba, but I am using the regular WP Search Block for search in order to have only one search widget that meets all the site’s needs. We use Relevanssi, which allows search by SKU in WooCommerce, a feature we need, instead of the WooCommerce Product Search Block, which doesn’t have that functionality as far as I know. Using Relevanssi, our Search Block will also search regular posts for content related to the products sold on the site, but as configured, it was showing hidden products.
I looked at Relevanssi’s settings, and you are correct: Relevanssi does have a setting called, “Respect exclude_from_search for custom post types” in Settings > Relevanssi > Search. I enabled it and it now prevents hidden products from appearing in search results. Relevanssi does show a warning when exclude from search is enabled that says, “You probably should uncheck this option, because you’ve set Relevanssi to index the following non-public post types: product_variation.” In my testing, I can still pull up product variations using the SKU, so I think we’re okay.
Thanks again.
Forum: Plugins
In reply to: [WooCommerce] Hidden products will appear in the search resultsI just tested a product whose visibility is set to “Hidden,” and it still shows up in search results for me. This particular site has Relevanssi installed, which I thought might be causing the problem, so I deactivated it, and got the same results: the hidden product shows up in search results, but not in the product catalog. The product doesn’t show up in my sitemap because I have its ID listed in my child theme’s function to block it. I have not tried the fix I linked to above to prevent the product from showing up in search.
I don’t want to post a link to the site because I don’t want to attract traffic to the site, but I’ll share it with you if there’s a more secure way to do so.
Forum: Plugins
In reply to: [WooCommerce] Cart in menu not visible anymoreGood job! It works for me now, and the classes are in there:
<i class=" fas fa-shopping-cart" aria-hidden="true" role="img"></i>Forum: Plugins
In reply to: [WooCommerce] Cart in menu not visible anymoreIt appears to be a problem with this line of the HTML:
<i class=" " aria-hidden="true" role="img"></i>I believe it should at least have a class, which would ordinarily be used to set the icon/image for the cart.
For example, using the font-awesome icons you have installed, you can show a shopping cart icon by changing the HTML to:
<i class="icon fas fa-cart-shopping" aria-hidden="true" role="img"></i>When I do that, testing the site live using Firefox’s developer tools, the shopping cart icon appears in the correct location, but is black instead of green, so the classes may be incomplete; I’m just guessing.
The question is, where did the correct classes go? I guess it could be due to a plugin and/or theme conflict. If you haven’t edited your theme’s files recently–an inadvertent deletion could explain the problem–you might have to temporarily walk back recent changes you made until the cart reappears.
Forum: Plugins
In reply to: [WooCommerce] Hiding Product Categories in ShopI don’t think I’d use CSS for this; the resources would still be used to output the hidden categories. I’d try to find a way to only display the ones you want.
I’m not familiar with that theme, which may have built-in settings for the main storefront, but have you considered using a custom home page with a shortcode to display the categories you want to show?
The Product Categories shortcode will allow you to specify the ids of the categories you want to show. Unfortunately, it doesn’t appear to support excluding categories unless they are empty, so if you have a lot of categories to show and just a few to exclude it might be cumersome.
Forum: Plugins
In reply to: [WooCommerce] Hidden products will appear in the search resultsHave you tried the fix described here?
Last time I tested, hidden products show up in the sitemap, too, without a fix:
// Exclude hidden products from the sitemap. add_filter( 'wp_sitemaps_posts_query_args', function ( $args, $post_type ) { if ('product' !== $post_type ) { return $args; } if (!isset($args['post__not_in'])) { $args['post__not_in'] = array(); } array_push( $args['post__not_in'], 2600, 2543, 2497, ); return $args; }, 10, 2 );You’ll need to replace the:
2600, 2543, 2497,with the list of product IDs of your hidden products. That’s a hassle if your list of hidden products frequently changes, but I haven’t found a better way without running a query as the snippet linked above does.
Forum: Plugins
In reply to: [Menu In Post] No Link TextExcellent. That’s important information. I’m glad you got things figured out.
Forum: Plugins
In reply to: [Menu In Post] No Link TextGood work!
Does my plugin work for you in multisite without the “Network: True” set?
Forum: Plugins
In reply to: [Menu In Post] No Link TextSo you’ve got the plugin network enabled, you’ve added the “Network: True” to the plugin file menu-in-post.php, and still get the same result?
Have you tried the other option, enabling the plugin on all subsites–even the ones where you don’t need it–to see what effect that has?
Forum: Plugins
In reply to: [Menu In Post] WPML compatibilityHi @collimarco,
I just noticed this post. I never got a notification that you posted.
The plugin has not been tested with WPML. I am not sure if it is compatible or not. If you try it, please post back with your results.
Forum: Plugins
In reply to: [Menu In Post] Menu for Custom Post TypesHi @vishanjad,
I haven’t heard from you in a while, so I’m going to mark this as resolved.
Forum: Plugins
In reply to: [Menu In Post] No Link TextI don’t use multisite, and consequently haven’t tested the plugin with it, so the problem you are seeing is most likely due to that, though it could be a conflict with another plugin or theme.
All the Menu In Post plugin really does is use a shortcode to add a menu using modified WordPress functions, and from what I’ve found searching the Internet, shortcodes in plugins and multisite may have issues.
I found this post with a workaround (enable the plugin on all sites to use the plugin on a subsite) as well as a suggested fix.
I would try the following to see if it works if you don’t want to enable the plugin on all sites.
Edit the file menu-in-post.php (on single site, it’s in wp-content/plugins/menu-in-post), and add:
Network: Trueto the end of the comments at the top so it looks like this:
/** * Plugin Name: Menu In Post * Description: A simple but flexible plugin to add menus to a post or page. * Author: linux4me * Author URI: https://profiles.ww.wp.xz.cn/linux4me * Text Domain: menu-in-post * Version: 1.1.8 * License: GPL3 * License URI: https://www.gnu.org/licenses/gpl-3.0-standalone.html * Network: True */After you’ve modified and saved the file, activate the plugin from the Network Admin. According to what I’ve found, that should make the shortcodes used by Menu In Post active on all your sites.
I can’t test this, but the main thing is that if you try the fix, you want a network install of the plugin, and the modification to the file adding “Network: True”.
Please let me know what you find out.
Forum: Plugins
In reply to: [Menu In Post] Styling DropdownHi @pitowner,
I haven’t heard back from you in a couple of weeks, so I’m going to mark this as resolved. Feel free to post again if you have more questions that I can help with.