Admin Functions for posts.

// Add an Edit Post Link to Archives edit_post_link( __( ‘{Edit}’ ) ); // Add page slug to body class for better styling. function wpcode_snippet_add_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] = $post->post_type…Continue reading

NMDFX Admin bar, Dashboard, Edits & Custom CSS

/* HIDE Monster Icon */ .monsterinsights-quick-links, .monsterinsights-float-right { display: none!important; } #monsterinsights_reports_widget { padding: 50px 0; } #monsterinsights_reports_widget .ui-sortable-handle { display: none!important; } /* Replace plugin logo */ .monsterinsights-logo-area img { content: url(‘https://www.coverings.com/wp-content/uploads/2024/11/Nation-Media-Dashboard-FX.png’); /* Adjust size if needed */ width:…Continue reading

Custom Tax Display Settings for Regular Prices by Specific Wholesale Roles

// Display regular price excluding tax for specific user role add_filter(‘woocommerce_get_price_html’, ‘custom_display_regular_price_ex_tax_for_role’, 100, 2); function custom_display_regular_price_ex_tax_for_role($price_html, $product) { // Only run on frontend and for logged-in users if (is_admin() || !is_user_logged_in()) return $price_html; // Get current user and their roles…Continue reading

Typography Enqueue

function typography_enqueue_styles() { // Enqueue Typeboost.css from Cloudflare CDN wp_enqueue_style(‘typeboost-css’, ‘https://cdnjs.cloudflare.com/ajax/libs/typeboost/1.0.0/typeboost.css’, array(), ‘1.0.0’); // Enqueue webfontloader.js from Cloudflare CDN wp_enqueue_script(‘webfontloader’, ‘https://cdnjs.cloudflare.com/ajax/libs/webfont/1.6.28/webfontloader.js’, array(), ‘1.6.28’, true); } add_action(‘wp_enqueue_scripts’, ‘typography_enqueue_styles’);Continue reading

Redirect from Array

function custom_redirect_old_new_urls() { $redirect_urls = array( ‘/oldpage/’ => ‘/newpage/’, ‘/oldpage1/’ => ‘/newpage1/’, // Add more URLs here ); $request_uri = home_url( add_query_arg( array(), $_SERVER[‘REQUEST_URI’] ) ); foreach ( $redirect_urls as $old_url => $new_url ) { if ( untrailingslashit( $request_uri )…Continue reading