Where do I go to edit this area? [closed]

Welcome to the site 🙂 Since you already know that the item you want to change is in framework/legacy/cranium/headers/views/global/_navbar.php then the matter of changing it is very easy and straightforward. First: Create a child theme (if you haven’t already). A child theme will allow you to change just the things you want while preserving the … Read more

Adding additional roles on registration

You check the role not for the created user, only the currently logged in user. Try this way: add_action( ‘user_register’, ‘se333727_additional_roles’ ); function se333727_additional_roles( $user_id ) { $new_user = get_user_by( ‘ID’, $user_id ); if ( in_array( ‘um_dueling-pianist’, (array)$new_user->roles ) ) { $new_user->add_role(‘pianist’); } }

Possible to merge these two functions?

Unless I’m missing something, I would think you could just use an OR (||) operator to check if it is_tag() or is_tax(): add_action( ‘pre_get_posts’, ‘sort_conference_by_date’ ); function sort_conference_by_date( $query ) { if ( $query->is_main_query() && !is_admin() ) { if ( $query->is_tag() || $query->is_tax() ) { $query->set(‘orderby’, ‘meta_value’); $query->set(‘meta_key’, ‘start_date’); $query->set(‘order’, ‘DESC’); } } }

Redirect website domain (including all pages) to external URL after Popup message (few seconds)

“Where” somewhat depends on the theme you’re using. Here’s couple examples, If you have a custom made theme, then you can put the code in any appropriate place. For example header.php (after <head>) or footer.php. If you have child theme, then you can copy a suitable template_part file from the parent theme to the child … Read more

load CSS only for administrators on backend

This is what I use, tested and works… function wpse_admin_styles(){ $user = wp_get_current_user(); if( !empty($user) && count(array_intersect([“administrator”], (array) $user->roles ))) { wp_enqueue_style( ‘admin_css’, get_stylesheet_directory_uri() . ‘/css/admin-styles.css’, array(), filemtime( get_stylesheet_directory() . ‘/css/admin-styles.css’) ); } } add_action(‘admin_enqueue_scripts’, ‘wpse_admin_styles’);

Warning: preg_match(): No ending delimiter ‘^’ found in

I usually try to avoid using preg_match(), because I get the pattern right very rarely. Perhaps you could try using some other functions to do the validating. For example PHP’s ctype_alnum() for the name field and WP’s is_email() for the email field. Like so, if ( $_POST[‘submission_name’] == ” ) { $flag = 0; echo … Read more

Is there a built-in function to duplicate existing posts?

You can add your one… /* * Function creates post duplicate as a draft and redirects then to the edit post screen */ function rd_duplicate_post_as_draft(){ global $wpdb; if (! ( isset( $_GET[‘post’]) || isset( $_POST[‘post’]) || ( isset($_REQUEST[‘action’]) && ‘rd_duplicate_post_as_draft’ == $_REQUEST[‘action’] ) ) ) { wp_die(‘No post to duplicate has been supplied!’); } /* … Read more

Compare meta key to current date in pre get post

What you’re trying isn’t possible with WP_Query. The reason is that because you have only stored the duration, it’s not possible to tell whether a post has expired until you know the publication date and the duration time and add them together. That’s what this does: $expire = get_field( ‘status_time_duration’ ) + get_the_time( ‘U’ ); … Read more