Customize Menu | Styling LESS/SCSS code formats

I was able to get SASS syntax highlighting in a code textarea in Customizer with the following: add_action( ‘customize_register’, function( WP_Customize_Manager $wp_customize ) { $wp_customize->add_setting( ‘favorite_html’ ); $control = new WP_Customize_Code_Editor_Control( $wp_customize, ‘favorite_html’, array( ‘label’ => ‘SASS’, ‘code_type’ => ‘sass’, ‘settings’ => ‘favorite_html’, ‘section’ => ‘title_tagline’, ) ); $wp_customize->add_control( $control ); } ); via @westonruter … Read more

WordPress Social Sharing Icons – Custom Placement

Here is a quick shortcode for you. You’ll still have to style it the way you want it.Just use:[social-share] to share. // social sharing shortcode, use [social-share] add_shortcode( ‘social-share’, ‘render_social_share’ ); function render_social_share( $atts ){ $social_output=”<p>Share on:</p> <ul> <li><a href=”https://www.facebook.com/sharer/sharer.php?u=” . get_the_permalink() . ‘” target=”_blank”>Facebook</a></li> <li><a href=”https://twitter.com/share?text=” . get_the_title() . “&url=” . get_the_permalink() . “” … Read more

Advanced WordPress plugin activation detection

The init and plugins_loaded hooks are already run before a plugin is activated. That’s why your first code doesn’t work but the second does. Regarding your third code: there’s no need to run add_action(‘myplugin_activate’ … inside init. Not everything needs to be hooked to init. Just use add_action(‘myplugin_activate’, function(){ echo ‘myplugin is not allowed.’; die; … Read more

Insert ads below the title

You can use mh_post_header action hook to add your ads content after the post title. Check the following code snippet for help add_action( ‘mh_post_header’, function() { echo ‘Ads content goes here’; }, 5 );