Double Slash After Media Path (uploads//)

if you are familiar with WP-CLI ( WordPress command-line interface ) you can very easily search and replace the wrong uploads// url with uploads/. you will need to install the wp-cli.phar file in the root of your directory. there are many tutorials online that explain how to install it for your relevant system. It is … Read more

How to set add_query_arg properly for home page?

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

Gutenberg Editor: dynamically edit slug field based on ACF field

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

Display parent page URL for child page

$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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)