store URL global before we redirect
How about adding parameters to the URL you redirect to: wp_redirect ( add_query_arg(“utm_source”, $thispage, get_permalink ( $post->ID ) )); and then checking the parameter on the target page?
How about adding parameters to the URL you redirect to: wp_redirect ( add_query_arg(“utm_source”, $thispage, get_permalink ( $post->ID ) )); and then checking the parameter on the target page?
You can use str_replace with __FILE__ to get the location of the current file. str_replace(ABSPATH, ”, __FILE__); So for example if __FILE__ returns: /users/chin/public_html/project-name/wp-content/theme/theme-name/functions.php The output would be: /wp-content/theme/theme-name/functions.php
You echo value of the field, so you get what you do 😉 There is no way to make ACF print it your way. You have to wrap it yourself. Here’s a code that would do exactly that: <?php if ( get_field(‘svcta_contact_information_group_svcta_contact_website’) ) : ?> <div class=”svcta-contact-website” id=”svcta-id-contact-website”> <strong>Contact Website:</strong> <a href=”https://wordpress.stackexchange.com/questions/304107/<?php echo esc_attr( get_field(“svcta_contact_information_group_svcta_contact_website’) … Read more
You have to include the protocol (scheme), like https://. So for Facebook it would be https://www.facebook.com/examplepage. It is in this case not WordPress that adds your site URL in front of the URL, it’s your browser!
Your URL querystring is malformed. ? good before the first variable. & goes before any others. Your url should be http://mysite/login?user_id=6&category=3
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
You can use conditional tag is_404() and wp action hook to redirect whenever the page can not be found. functions.php add_action( ‘wp’, ‘se344018_redirect_404’ ); function se344018_redirect_404() { if ( is_404() ) { wp_redirect( home_url() ); // // wp_redirect( home_url(‘some/page-slug’) ); exit; } }
Spammers use the URL of unapproved comments to share around the Internet. This makes the comments viewable until the comment is dealt with via approval process. WordPress’ contributors are working on a patch for the next version. https://core.trac.wordpress.org/ticket/49956
I can guarantee that somewhere on your technology stack (edge CDN, Firewall, Web Server, WordPress Plugin) that you have something configured that throws a 403 error whenever you try to access a URL on your site without the User-Agent Header set. Hence why it works when you access in the browser (as this will contain … Read more
This post provides a function, but it cannot handle non-latin characters. That’s because URLs can’t have non-latin/ASCII characters. Browsers might show non-latin characters to you, but it’s just a user interface feature. For example, if you visit this Wiktionary URL: https://en.wiktionary.org/wiki/わかもの#Japanese, you browser URL encodes the japanese characters to get the real URL: https://en.wiktionary.org/wiki/%E3%82%8F%E3%81%8B%E3%82%82%E3%81%AE#Japanese then … Read more