add query string to all pages after user logged in

add following code to functions.php, add_action(‘wp_head’, ‘your_function’); function your_function(){ if ( is_user_logged_in() ) { $genre_url = add_query_arg(‘aff’, ‘1234567’, get_permalink()); } } Hope this will help you. for more information, is_user_logged_in() How can I include a query string with get_permalink wp_head action hook get_permalink()

Transform .wp-video to the native video player of the browser

I’ve found the right way digging through the WP documentation: https://developer.wordpress.org/reference/hooks/wp_video_shortcode/ This code seems to do the trick: function buildVideoPlayer($output, $attr) { // $output contains the default HTML string, created by the WP core // $attr is an associative array, which contains the parameters // (src, poster, preload, etc.) specified in the shortcode // The … Read more

PHP Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered

Before you can use, those two lines : wp_enqueue_style( ‘wp-auth-check’ ); wp_enqueue_script( ‘wp-auth-check’ ); you should register those assets, inside wp_enqueue_scripts or admin_enqueue_scripts, like the following : function my_assets() { wp_register_style( ‘wp-auth-check’, ‘path/to/style’, $deps = array, $ver = false, $media=”all” ) wp_register_script( ‘wp-auth-check’, ‘path/to/your-script’, $deps = array, $ver = false, $in_footer = false ) } … Read more

How To Apply Different Styles To All Blocks Based on Post Meta Value?

I was able to solve this problem by using the admin_body_class filter to add a class name to the <body> element of the admin page, and writing selectors for that class in my stylesheet. add_filter( ‘admin_body_class’, ‘add_status_classes’ ); function add_status_classes( $classes ) { $post_meta = get_post_meta( get_the_ID() ); $is_darkmode = $post_meta[‘_is_post_dark_mode’]; if ( $is_darkmode ) … Read more

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