How to I know the class or ID of my theme?

I have just noticed you have solved your problem after I wrote this answer. I’m posting it anyway for future visitors. Various web browsers have an “Inspect” function built in, for example; Firefox, Google Chrome, Chromium, Bravve etc. How to Inspect pages Load up the page you want to examine in an appropriate web browser … Read more

How to add custom color fields to the category edit page?

To add custom fields and save/update meta data to terms, you basically need to use these action hooks. custom fields html for new term {$taxonomy}_add_form_fields save custom field data for new term, get data from $_POST created_{$taxonomy} custom fields html for existing term {$taxonomy}_edit_form_fields save custom field data for existing term, get data from $_POST … Read more

Implementing a simple slider in code?

First off, you shouldn’t insert <script> tags into WordPress’s template files. The proper way to add Javascript code is to use wp_enqueue_script(). If I’m reading this right, it appears you’re using jQuery code, so you’ll need to ensure that jquery is in the $deps array in your wp_enqueue_script() call. Also, WordPress uses jQuery in noConflict … Read more

How to add CSS via custom plugin?

Here’s your problem: wp_enqueue_style( ‘style’, get_stylesheet_uri() ); wp_enqueue_style( ‘slider’, get_template_directory_uri() . ‘test.css’, array(), ‘1.1’, ‘all’); Neither of those files are in your theme. get_stylesheet_uri refers to the style.css that has the themes name etc, and get_template_directory_uri is the URL of the parent theme. Neither of those are your plugin folder. You can confirm this by … Read more

Override plugin styles via my custom theme

Plugins don’t need to “get” styles. You just need to enqueue your own stylesheet with styles for the markup used by that plugin. If the plugin is on the front-end, your styles could even just be added to your child theme, or Appearance > Customize > Additional CSS. If the plugin elements you want to … Read more

How to edit the default icon of Add Media button?

this function get_stylesheet_directory_uri() return URI to current theme’s stylesheet directory and /css/my-admin.css is path to their file which you can create in your theme directory example : <link rel=”stylesheet” type=”text/css” id=”my-css” href=”https://yourdomain.com/wp-content/themes/yourtheme/css/my-admin.css”> this is the output of the code in your source

Excluding a media query from specific pages

There’s nothing like that with media queries. You need to include the exclusion in your CSS selectors, like this: body:not(.home) .site-header { // etc. } Alternatively, if this is the only CSS in a particular file, you could just not enqueue it on the homepage: add_action( ‘wp_enqueue_scripts’, function() { if ( ! is_front_page() ) { … Read more

how customise Woocommerce style of custom theme

You can add your own css based on the classes created by WooCommerce. If you are working in a (child)theme, you can add a stylesheet by adding this code in functions.php: /** * Enqueue your own stylesheet */ function custom_wp_enqueue_woocommerce_style(){ wp_register_style( ‘mytheme-woocommerce’, get_template_directory_uri() . ‘/css/woocommerce.css’ ); if ( class_exists( ‘woocommerce’ ) ) { wp_enqueue_style( ‘mytheme-woocommerce’ … Read more