Change product_base programmatically

Use your plugin activation hook to make the change. That will only run once, when your plugin is first activated, allowing the user to overwrite that change later (if they want to). register_activation_hook( __FILE__, function () { if ( $permalinks = get_option( ‘woocommerce_permalinks’ ) ) { $permalinks[‘product_base’] = ‘property’; update_option( ‘woocommerce_permalinks’, $permalinks ); flush_rewrite_rules(); } … Read more

Custom URL rewrites for templates

Since you want to add something to the end of every post/page rewrite rule, you probably can just add a rewrite endpoint. These are regexes of the form /[endpoint_name](/[optional_extra_stuff])? that are appended to the already generated rules for pages, posts, archives, … You define on which structures you want to add them by setting the … Read more

RSS feed link on archives page not working

I made a mess of this in comments, so will start from scratch. The feed links for archive pages are usually only outputted for browser detection by feed_links_extra(). From looking at its source there is number of different function to get link for the archive pages: get_category_feed_link( $cat_id ); get_tag_feed_link( $tag_id ); get_term_feed_link( $term_id, $taxonomy … Read more

Strange behavior with a redirect loop – involves WPML multi-language plugin

Your site is misconfigured, but from remote it’s not easy to say where exactly. For the redirects, it’s going this way: requesting http://internationalgateway.us/fr 301 redirect to http://internationalgateway.us/fr// requesting http://internationalgateway.us/fr// 301 redirect to http://internationalgateway.us/fr/ requesting http://internationalgateway.us/fr/ go to 2. This is the redirect loop your page creates unrolled. To debug this, you can make use of … Read more

Can’t get permalinks working!

Inside of your config you have the following: <Directory /> Options FollowSymLinks AllowOverride None </Directory> You should change it to the following: <Directory /> Options FollowSymLinks AllowOverride All </Directory> The AllowOverride directive is what allows the .htaccess file to be read. If you still have trouble, make sure you change this in the <Directory “/var/www/html”> … Read more

Link to Particular Page Within Template PHP Code

You probably want to use get_permalink and get_the_title. Example: <a href=”https://wordpress.stackexchange.com/questions/19555/<?php echo get_permalink( YOUR POST ID ); ?>”><?php echo get_the_title( YOUR POST ID ); ?></a> Replace YOUR POST ID with the ID of the post you’d like to link to. Post ID’s will change from install to install, however, so this might not work as … Read more

rename ‘page’ URL fragment in pretty permalinks

A bit late but maybe usefull for someone elseā€¦ code goes to functions.php. You have to flush your rewrite rules. <?php // Set custom pagination_base function mytheme_pagination_base() { global $wp_rewrite; $wp_rewrite->pagination_base=”pagina”; } add_action( ‘init’, ‘mytheme_pagination_base’ );