How to create different navigation for registered users in WooThemes Canvas?

add_action(‘init’,’wpsites_members_menu’); function wpsites_members_menu(){ if(is_user_logged_in()){ add_filter( ‘wp_nav_menu_args’ , ‘logged_in_nav_menu’ ); } } Display Different Nav Menu For Logged in and Logged Out Users Source: http://wpsites.net/web-design/members-nav-menu-logged-in-members/ function logged_in_nav_menu( $args ) { if ( $args[‘theme_location’] == ‘primary’ ) { $args[‘menu’] = ‘members’; } return $args; }

Restrict access to specific widget field based on user role

I ended up adding the class ‘ab-ads’ to all my widget areas. if ( !is_super_admin() ) { add_action(‘admin_print_styles-widgets.php’, function() { echo ‘<style type=”text/css”>div.sidebar-widgets-ab-ads { display:none; }</style>’; }); } That way I just hide them for everyone that isn’t administrators.

How to enqueue javascript for WP Customize options sidebar?

Use the action customize_controls_enqueue_scripts: add_action( ‘customize_controls_enqueue_scripts’, ‘enqueue_customizer_scripts’ ); function enqueue_customizer_scripts() { wp_enqueue_script(); // fill in the details here } To add inline scripts in the header, use the action customize_controls_print_scripts. See wp-admin/customize.php for details.

Echo all category names, apart from one

the_category echos content. You will not be able to use string manipulation. No strings are returned that you could manipulate. They are just echoed immediately. You could completely filter out a particular category, which seems to be an option, with this: function cat_filter_wpse_137596($categories) { foreach ($categories as $k => $c) { if (‘uncategorized’ === $c->slug) … Read more

Page has a parent and $post->post_parent returns 0

Try echoing serialized($post); to make sure you’re looking at the right page(s). It should return the post_parent so the problem may be either in the call you’re making to get $post, or double-check that the set of pages did save with a parent page. Easiest way of doing that is call up “All Pages” and … Read more