jazzu
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Removing tags which I already deleted from GoogleHello @wpcoworker !
When you replied, I checked out XML sitemap again and I can’t find tags anywhere. I uploaded the XML sitemap to Google Search Console again and I also have tags disabled in Yoast plugin. I checked the site:moj-bazen.si on Google again, and tags are still there. I even went to Remove tab in Google Search Console and disabled all links that start with https://moj-bazen.si/oznaka-izdelka/ , which is just /tags/. It was confirmed, but the tags are still there.
Creating a redirect won’t be a problem, but I don’t want /tags/ to be visible anywhere at all.
Kind regards
- This reply was modified 2 years, 6 months ago by jazzu.
Forum: Fixing WordPress
In reply to: Removing tags which I already deleted from GoogleHi @wpcoworker .
That’s exactly what’s bothering me – I re-submitted the sitemap 3 times already since I deleted tags and fixed sitemap. I can’t find tags anywhere in the sitemap, but they still appear on Google.
Forum: Developing with WordPress
In reply to: Changing search URLHello again!
Sorry for the late reply. I tried it on my staging website. I disabled all plugins except WooCommerce and changed the theme to Twenty Twenty-Two. The only code in functions.php is this:
/* Change search page slug. */ function wpb_change_search_url() { if ( is_search() && ! empty( $_GET['s'] ) ) { wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) . '/?post_type=product' ); exit(); } } add_action( 'template_redirect', 'wpb_change_search_url' ); //enable /search/ path for products function custom_rewrite_rule() { add_rewrite_rule('^search\/([^/]*)\/?','index.php?post_type=product&s=$matches[1]','top'); } add_action('init', 'custom_rewrite_rule', 10, 0 );
Then, I went to settings, permalinks and just saved, without changing anything there. Went to the website and tried searching for something and still got /search/sesalnik/?post_type=product
Kind regards and thank you very much for your time!
Forum: Developing with WordPress
In reply to: Changing search URLHello again.
I don’t know why my results would be different. I tried clearing cache, I replaced this code
/* Change search page slug. */ function wpb_change_search_url() { if ( is_search() && ! empty( $_GET['s'] ) ) { wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) . '/?post_type=product' ); exit(); } } add_action( 'template_redirect', 'wpb_change_search_url' );
With
//enable /search/ path for products function custom_rewrite_rule() { add_rewrite_rule('^search\/([^/]*)\/?','index.php?post_type=product&s=$matches[1]','top'); } add_action('init', 'custom_rewrite_rule', 10, 0 );
and it returned back to default ?s=[searchterm]&post_type=product. I tried adding your code under the code I had before after that, like this
/* Change search page slug. */ function wpb_change_search_url() { if ( is_search() && ! empty( $_GET['s'] ) ) { wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) . '/?post_type=product' ); exit(); } } add_action( 'template_redirect', 'wpb_change_search_url' ); //enable /search/ path for products function custom_rewrite_rule() { add_rewrite_rule('^search\/([^/]*)\/?','index.php?post_type=product&s=$matches[1]','top'); } add_action('init', 'custom_rewrite_rule', 10, 0 );
It just displayed the normal /search/[searchterm]/?post_type=product, and nothing changes. The code works to the part that it atleast shows the /search/[searchterm]/?post_type=product instead of /?s=, but ideally in my case would be /iskanje/[searchterm]
I really didn’t expect changing the URL would be such a difficult issue ??
- This reply was modified 2 years, 7 months ago by jazzu.
Forum: Developing with WordPress
In reply to: Changing search URLHello @bcworkz !
Thank you for your reply. I removed my code and added
function custom_rewrite_rule() { add_rewrite_rule('^search/([^/]*)/?','index.php?post_type=product&s=$matches[1]','top'); } add_action('init', 'custom_rewrite_rule', 10, 0 );
After I added the code and flushed the permalinks, everything looked like it was originally. I also tried the same code in regexr.com, except that I changed it a bit, just like you said. I changed it to:
function custom_rewrite_rule() { add_rewrite_rule('search\/([^/]*)\/?','index.php?post_type=product&s=$matches[1]','top');}add_action('init', 'custom_rewrite_rule', 10, 0 )
Everything is green/yellow in the explain tab in tools. What do I do now?
Forum: Developing with WordPress
In reply to: Changing search URLRight. I checked the add_rewrite_rule() link you added and regexr.com. Like I said, sadly I don’t have any experience with PHP coding yet, so I don’t know what I’m searching for exactly. I was checking out plugins, but couldn’t find any that would allow me to do this. When you said that the challenge would be coming up with a regexp that matches /search/ requests without matching others, what did you mean by that?
Forum: Developing with WordPress
In reply to: Changing search URLI changed the code to:
/* Change search page slug. */ function wpb_change_search_url() { if ( is_search() && ! empty( $_GET['s'] ) ) { wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) . '/?post_type=product' ); exit(); } } add_action( 'template_redirect', 'wpb_change_search_url' );
Now the URL looks a bit better, but I still can’t manage to translate the /search/ to /iskanje/ and I would still need to remove the post_type=product from the URL.
Forum: Developing with WordPress
In reply to: Changing search URLHi @bcworkz !
No, I don’t want the actual URL to display the post type, I just want it to search for the products. Yeah, I have practically no PHP coding skills, so there’s that.
Kind regards and thank you
Forum: Developing with WordPress
In reply to: Changing search URLHi @bcworkz !
Thank you for your reply. I understand what you mean. No, I don’t need or want blog search functionality, I need the search to only find products, but sadly, I don’t know what to change or add in the code to do that. Is it the get_query_var (‘s’) part in the third line?
Kind regards
Forum: Developing with WordPress
In reply to: Changing search URLHi @gappiah !
Thank you for your reply. I tried it, now my code looks like this:
/** * Change search page slug. */ function wpb_change_search_url() { if ( is_search() && ! empty( $_GET['s'] ) ) { wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) ); exit(); } } add_action( 'template_redirect', 'wpb_change_search_url' ); function re_rewrite_rules() { global $wp_rewrite; $wp_rewrite->search_base = ‘iskanje’; $wp_rewrite->pagination_base = ‘stran’; $wp_rewrite->flush_rules(); } add_action(‘init’, ‘re_rewrite_rules’);
However, the Allewar’s part that I added doesn’t do anything for me. It still just changes the URL to /search/. It still changes the layout of the products, which I don’t want. If you want to check, here’s the /search/%C4%8Drpalka link.
Kind regards
Forum: Fixing WordPress
In reply to: Can’t center a bankart table!Just for information – I managed to fix it. The problem was that I was trying to align the wrong element. I had to edit the article#post to actually get it to work.
Kind regards
Forum: Plugins
In reply to: [WooCommerce] Shop appearance (adding dividers to the shop)Okay, it’s pretty clear that we didn’t understand eachother, but thanks for attempting to help! The problem was the gap between actual categories, which I fixed with margin: 0 !important.
Kind regards
Forum: Plugins
In reply to: [WooCommerce] Shop appearance (adding dividers to the shop)Hi @csnlima !
Thank you for your reply.
I’ll make myself more clear – The shop is displaying exactly what I want – categories and products. What I want is to put a border / divider between the actual categories and products (like a line between them) or something like that.
I tried using CSS to create a border on the bottom of categories, however, since they are not physically connected, there are gaps in the border, which I don’t want.
Kind regards
Forum: Plugins
In reply to: [Price Per Unit For WooCommerce] Changing how the price is displayedHi @apurbajnu .
Currently I can’t write another request there, because when I open the link, it tells me that the site encountered a critial error. Besides, I already wrote a ticket there, asking for an email I could use to give you access.
Kind regards
Forum: Fixing WordPress
In reply to: Translating page number URLTried it again. Sends me to the homepage again. I did go and check Redirections plugin and found this in 404 tab: Screenshot
Kind regards