WordPress CSS problems with controls

Yes, this can easily be cleaned up with a little CSS. You can start by using the browser’s inspector, hit F12 to open it, and select the element you want to style. See if that form or something around has an ID, use that to target each element so you don’t effect other pages or … Read more

WordPress 6 – inline container styles breaking my site

These styles are styles applied through the block settings toolbar. This code will remove the wp-container-id class for every block: remove_filter( ‘render_block’, ‘wp_render_layout_support_flag’, 10, 2 ); This was found on this page. It has more advice on removing block styles and altering them as well. Also found on the above page was this code to … Read more

Add second background-image on hover

Use a single element, with a pseudo element (:before) for the featured image, and appropriate hover styling to set its opacity and reveal a blend with the underlying second image. I threw in a gradual image transition just to make it look a little nicer. html: <div class=”my-image-holder”> text and other contents we don’t want … Read more

Add a unique body class for every admin page (including trash)

You can hook to admin_body_class: add_filter( ‘admin_body_class’, ‘set_admin_page_as_body_class’ ); /** * Create a body class based on the current admin page. * * @param string $classes The current admin body classes. * @return string */ function set_admin_page_as_body_class( $classes ) { /** * For safety, I always check for get_current_screen before I use it. * May … Read more

Append style tag in head while shortcode runs

I also get this script tag shown in my shortcode output alongside my html that shortcode returns. How can I not have this script tag shown in my shortcode output. Never use echo statement in a shortcode. A shortcode should only return something to display on front-end. As per WordPress Codex : Note that the … Read more