flush_rewrite_rules on MultiSite
flush_rewrite_rules on MultiSite
flush_rewrite_rules on MultiSite
Cannot Set Custom Permalinks for Multisite Post Migration
Is there a problem with the code? Your code is already properly adding the lang query variable to the homepage URL. But you need to understand these points: On the homepage URL becomes http://localhost/mywebsitename/?lang=en which should be ok $wp->request is empty on the homepage, hence the above URL is expected. And you could use get_queried_object()->post_name … Read more
I’ve found the way to edit the slug’s field. Just simply use: wp.data.dispatch(‘core/editor’).editPost({slug: ‘my-slug-value-here’}); With an event listener like this, I can dynamically change the slug field based on a custom field: jQuery(document).ready(() => { const acfField = ‘field_61f8bacf53dc5’; const inputShortTitle = document.getElementById(‘acf-‘ + acfField); const slugify = (str) => { return str.toLowerCase().replace(/ /g, ‘-‘) … Read more
$post->post_parent returns 0 when there’s no parent associated. You need to check if the value is greater than 0. <?php global $post; if ( $post->post_parent > 0 ) { ?> <a href=”<?php echo get_permalink( $post->post_parent ); ?>” > <?php echo get_the_title( $post->post_parent ); ?> </a> <Br><?php echo get_permalink( $post->post_parent ); ?> <?php } ?> Also, … Read more
Change permalink structure specific category
Add .html permalink to post if specific category
How to use category slug with a regular page
Adding /blog in front of single posts (only)
Custom WooCommerce rewrite rules with comma delimiter