Woocommerce – WordPress Roles & Capabilities

Using the Access plugin, you can create more fined grained access control and achieve better administration of your site. Use the following steps to create your own roles with custom permissions for Woo-commerce. 1. Create a custom role. 2. Click on Change permissions for that role, click on Woo-commerce capabilities to display related ones and … Read more

Print posts category or tag as a formatted journal

You don’t have to use a specific plugin to achieve columns in print, you can modify how your layout looks when printing using the print CSS media query. You can learn more about this topic here. In case of the WP Journal plugin to print 3 columns of text add this: @media print { .cols3 … Read more

check uncategorized category by default

It doesn’t need to be checked to work. When you publish the post, as long as you haven’t added another category and explicitly checked it, WordPress will automatically assign the Uncategorized category for you. Once you hit publish and the page refreshes you’ll see the checkbox checked.

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