how do links move when I move my site?

Some links (those built in code) will automatically change to your new domain. Others (those in post content) you will want to swap out using something like better search replace to swap out localhost for your new domain.

Unique one time use URL

You could add a setting using add_option( ‘access_keys’, [ ‘key_1’, ‘key_2 ] ) to check against when loading the page. add_action( ‘init’, ‘wpse339612_check_access_codes’ ); function wpse339612_check_access_codes(){ if( isset( $_GET[‘key’] ) ){ $available_keys = get_option( ‘access_keys’ ); $key_index = array_search( filter_var( $_GET[‘key’], $available_keys ); if( $key_index !== false ){ /*User has access! Delete the key from … Read more

Custom function making troubles in get_permalink for ACF relationship fields

You shouldn’t rely on the global $post variable for filters like this. In your example you’re passing $event_city->ID to get_the_permalink(). This implies that the $event_city post is not for the same post as the current $post object. This is normal. Sometimes you want to use a function like get_the_title() or get_the_permalink() without changing the global … Read more

How can I say if a URL is a post, page, or taxonomy archive?

WordPress sites usually use body_class(), which adds CSS classes to the <body> tag. If you inspect the body element itself, most sites will show you something like <body class=”page-template page-template-tpl-events page-template-tpl-events-php page page-id-1168 page-parent page-child parent-pageid-378″> You can tell from these classes that this is a Page, using a Page Template, it is a Parent, … Read more

Giving a new page an existing URL

The process to do this isn’t probably as complex as you think. Leave the existing page exactly as-is. Don’t change its slug etc. Create a new page draft Create the new page content as you’d like it to have. Once the new page is complete, and ready to go, go back to the original page … Read more

Internal linking when on a shared IP

You can wrap the links in echo home_url($path) to have them printed relative to the site. So your link would be coded as: <a href=”https://wordpress.stackexchange.com/questions/3844/<?php echo home_url(“https://wordpress.stackexchange.com/services”)?>”>

How to remove .html from admin

In my eyes the plugin is pretty useless because of two reasons: You can setup the permalinks on your own by adding .html to it. There is no need for the plugin. As Shahas Katta commented, there is genereally no need to have .html at the end of URLs. As I don’t know your site … Read more

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