changing font size and font of a custom message added after comment

You can use CSS, either in a separate CSS file like this: .wpd-custom-text{ color: #f44242; font-family: “Times New Roman”, Times, serif; font-size: 15px; font-weight: 900; } or inline like this: <div class=”wpd-custom-text” style=”color:#f44242; font-family: ‘Arial’, ‘Helvetica’, sans-serif; font-size: 15px; font-weight: 900;”>the comment added here is by the author and my website doesn’t have any take … Read more

Color swatches on category page? [closed]

Try this code add_action( ‘woocommerce_after_shop_loop_item’, ‘sm_display_product_color_options’, 9 ); function sm_display_product_color_options(){ global $woocommerce, $product; $variation_colors_data = $product->get_attributes(); $variation_colors_data = $variation_colors_data[‘color’]; $variation_colors = $variation_colors_data[‘options’]; echo “<div class=”product_colors_container”>”; foreach ($variation_colors as $variation_color) { echo “<div class=”variable-item-span variable-item-span-color” style=”background-color:”.$variation_color.””>”.$variation_color.”</div>”; } echo “</div>”; } Review below screenshot

Bind JS event to WordPress control customizer

You need to enqueue a separate script on a different action with a different dependency. /** * Enqueue styles and scripts for the Customizer pane. */ function mytheme_customize_pane_enqueue() { wp_enqueue_script( ‘mytheme-customizer-control’, get_template_directory_uri() . ‘/js/customizer-control.js’, array( ‘customize-controls’ ), ‘20180924’, true ); } add_action( ‘customize_controls_enqueue_scripts’, ‘mytheme_customize_pane_enqueue’ ); The JS looks like this: ( function( wp, $ ) … Read more

Adding posts to custom menu [closed]

By default you can add posts to menus, so you should be able to see it. There are two reasons, why you don’t see it: Some plugin/theme modified the built-in post type so it can’t be added to menus (I don’t believe anyone would try it). You disabled posts in screen options. Go to Appearance … Read more

Add custom profile field only for site admins?

user_contactmethods filter hook passes two parameters to the registered functions. The second parameter is the WP_User object, with the help of which you can check roles and caps of the edited user. add_filter( ‘user_contactmethods’, ‘se330743_user_contact_methods’, 20, 2 ); function se330743_user_contact_methods( $user_contact, $user ) { // — fields for admins — if ( !in_array(‘administrator’, (array)$user->roles) ) … Read more