Sort new column in Users wp-admin

If orderby equals post_count, WordPress will always work with posts from the default post type post. What you can do is, try to modify that part of the query for this specific case. Something like this should work: add_filter( ‘query’, ‘smartwp_sort_last_login_column_query’ ); function smartwp_sort_last_login_column_query( $query ) { if ( ! is_admin() ) { return $query; … Read more

Is it possible to hide nav menu items only when they are page titles (on specific templates) but not on the dashboard?

You can use is_admin() to check if the request is done being inside /wp-admin. function suppressed_title($title, $id) { if (is_admin()) { return $title; } if (get_page_template_slug() === ‘custom-template.php’ && get_post_type($id) === ‘page’) { $title=””; } return $title; } add_filter(‘the_title’, ‘suppressed_title’, 10, 2); I changed your code to use triple equals === over == as this … Read more

Replace custom SVG icons in Twenty Twenty-One

That’s not how that file works, and including it will just load the class definition, it won’t create a Twenty_Twenty_One_Child_SVG_Icons object or override Twenty_Twenty_One_SVG_Icons. It’s also not how child themes work. Child themes let you override templates specifically, not arbitrary files and classes. Instead, use the twenty_twenty_one_svg_icons_{$group} filters to modify the array in your child … Read more

I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics

I would stick to make the url https://example.com/life/life-article/?special=1 I would create a php function that: retrives all posts and stores them in a variable; make a loop to loop all the posts and check if they are “life” posts; inside the same loop, if they are “life” posts, change their slug to …whatever/?special=1; and then … Read more

Add css class to string

Unless you have a different function that we are not seeing, in the <td> of your html, you are calling the function “rcp_print_membership_status”, however, your function name in the first code example is “rcp_get_status_label”. Are you trying to call that first function? If so: As reads: <?php rcp_print_membership_status( $membership->get_id() ); ?> Should read: <?php rcp_get_status_label( … Read more