Showing Different Code on Pages With Different Layouts

function add_js_one_col_wpse_107240() { if (is_page()) { $pobj = get_queried_object(); if(!empty(get_post_meta($pobj->ID,’one-col’,true)) { wp_enqueue_script(/* … */); } else { wp_enqueue_script(/* … a different script … */); } } } add_action(‘wp_enqueue_scripts’,’add_js_one_col_wpse_107240′); get_queried_object will get you the page information. It will be a WP_Post object on a “Page”. global $post should probably work too, but this is cleaner. Use … Read more

add_menu_page does not render the expected result

as the 5 parameter to add_menu_page() you send the resultat of running the function, insted of sending a callable reference to the function, as you did in the add_action. $hookname = add_menu_page ( ‘My Slider’, ‘My Slider’, ‘manage_options’, ‘my_slider’, array( ‘My_Slider’, ‘render_admin_menu’) );

Add pages content to startpage through custom menu

You can use get_nav_menu_locations and wp_get_nav_menu_items to get your menu items. $locations = get_nav_menu_locations(); $nav_items = wp_get_nav_menu_items($locations[‘your-menu-slug’]); You can then process $nav_items to display your page content. It can get complicated but it does work.