Twenty Ten child theme has post on an inner page. Cant get that page to use my desired template
try this instead <?php get_sidebar(2); ?>
try this instead <?php get_sidebar(2); ?>
Add a meta box to the post editor, similar to the excerpt meta box, and get the content of the meta box in your sidebar. If you want to reuse the same text on different pages create a custom post type sidenotes and add a meta box with a select field to let the author … Read more
Look in the parent theme’s functions.js. It looks like an implementation of the “sticky footer” concept. The margin is being set via script: var body = $( ‘body’ ), _window = $( window ); /** * Adds a top margin to the footer if the sidebar widget area is higher * than the rest of … Read more
Hi @ewakened: The simplest solution would be to have them upload the ads as photos using the media features in WordPress and then to have them add custom field called “Advertisement” with the URL to the ad copied from the media module, and a custom field called and “Ad URL” to link to the advertiser’s … Read more
I spent almost two months building and debugging Total Widget Control to do exactly this for all of a sites widgets. Bear with me as I strip the code out of Total Widget Control and try to make it usable for you. global $wp_query $twc_menu_item_object = $wp_query->object_id; //is the object id of the current page. … Read more
Get sidebar is a really thin wrapper around locate_template, which just searches the current child theme and parent theme directory for the given sidebar. get_sidebar in wp-includes/general-template.php: $templates = array(); if ( isset($name) ) $templates[] = “sidebar-{$name}.php”; $templates[] = ‘sidebar.php’; // Backward compat code will be removed in a future release if (” == locate_template($templates, … Read more
After much search I found an explanation to the mystery: With the new Twenty Eleven theme (from WordPress 3.2 and up), the sidebar is gone in the single post page.
The code for this plugin is actually pretty simple. The init function loops through all the sidebars (stored in the wp_options table) and registers them in wordpress: <?php function init(){ //go through each sidebar and register it $sidebars = sidebar_generator::get_sidebars(); if(is_array($sidebars)){ foreach($sidebars as $sidebar){ $sidebar_class = sidebar_generator::name_to_class($sidebar); register_sidebar(array( ‘name’=>$sidebar, ‘before_widget’ => ‘<li id=”%1$s” class=”widget sbg_widget … Read more
You can cut a lot of steps out of this if you use get_users() instead of your custom SQL query. You can then select a random user out of that array using array_rand() (native PHP function, not a wordpress function) and it will return the key you should be using. Here’s an example: $users = … Read more
Register sidebar. add_action( ‘widgets_init’, ‘wpse_123456_widgets_init’ ); function wpse_123456_widgets_init() { $args = array( ‘name’ => __( ‘Sidebar name’, ‘theme_text_domain’ ), ‘id’ => ‘unique-sidebar-id’, ‘description’ => ”, ‘class’ => ”, ‘before_widget’ => ‘<li id=”%1$s” class=”widget %2$s”>’, ‘after_widget’ => ‘</li>’, ‘before_title’ => ‘<h2 class=”widgettitle”>’, ‘after_title’ => ‘</h2>’ ); if ( function_exists (‘register_sidebar’)) { register_sidebar( $args ); } } … Read more