custom filed from post in the side bar
If it’s a single post or page, you can just pass the global $post->ID: echo get_post_meta($post->ID, ‘fb_name’, true);
If it’s a single post or page, you can just pass the global $post->ID: echo get_post_meta($post->ID, ‘fb_name’, true);
It’s a bad idea to try to make the wp-admin area look like the front-end. It’s an uphill battle. Try using my Front-end Editor plugin: it allows editing widgets directly from the front-end etc.
Sounds like you could use page templates for this. You’d create a file in your theme called ‘page-services.php’ (for instance). When users create new pages, they’d select the “Services” template, rather than the “Services” sidebar, but it’s basically the same thing for your purposes. Here’s how to set up templates: http://codex.wordpress.org/Pages#Page_Templates And here’s the conditional … Read more
You would register the sidebar in the functions.php file with something like this: <?php register_sidebar(array(‘name’=>’custom-content’, ‘before_widget’ => ‘<section>’, ‘after_widget’ => “</section>”, ‘before_title’ => ‘<h3>’, ‘after_title’ => “</h3>” )); ?> And Use it in your theme like this: <div class=”contents”> <?php if ( function_exists(dynamic_sidebar(1) ) ) : ?> <?php dynamic_sidebar(custom-content); ?> <?php endif; ?> </div>
If i understand correctly, a quick solution could be using something like Widget Logic and create a custom menu for each category, then use whatever Conditional Tags applies.// such as is_category() or in_category( ‘5’ ) Or, if you don’t want to use a plug-in, you could try duplicating the widget and then adding the conditional … Read more
An alternative method to what @Tanmoy gave above is to make an additional navigation menu (Appearance – Menus) and call it something like Sidebar-Pages. Then you can add the headers with a “link” like #. Add the sub-pages you want and save when you’re done. Then go to widgets (Appearance – Widgets) and there you … Read more
Add the following code in your functions.php file of the theme directory. Replace widget name “Home Widget Area” with your widget’s name /*=============WIDGETs CSS CLASS CONTROLLER==============*/ $GLOBALS[‘my_widget_num’]=1; function edei_widget_class_adder($params){ if( $params[0][‘name’]==’Home Widget Area’ ){ $GLOBALS[‘my_widget_num’]++; if( ($GLOBALS[‘my_widget_num’]%4)==0 ){ $params[0][‘before_widget’] = str_replace(‘class=”‘, ‘class=”marginAdjust ‘, $params[0][‘before_widget’]); } } //print_r($params); return $params; } add_filter(‘dynamic_sidebar_params’,’edei_widget_class_adder’); function edei_widget_counter_reset($sidebars_widgets) { $GLOBALS[‘my_widget_num’] … Read more
Since the sidebar was being deployed while inside the loop, the if ( have_posts() ) : was what was causing it to break. Here’s the fix: <div id=”FL-pest-libray-sidebar”> <?php $category_query_string = new WP_Query(array( ‘post_type’ => ‘page’ , ‘posts_per_page’ => ‘-1’ , ‘post_parent’ => ‘413’)); while ( $category_query_string->have_posts() ) : $category_query_string->the_post(); ?> <div <?php $catspacetitle = … Read more
You need to wrap this in a function then add it to the widgets_init action. Also the register sidebar function does not have $arguments for sort_column or sort_order. I would also change the id to ‘sidebar-‘.$page->ID add_action( ‘widgets_init’, ‘prefix_register_sidebars’ ); function prefix_register_sidebars() { foreach($pages as $page){ register_sidebar( array( ‘name’=>$page->post_title, ‘id’=> ‘sidebar-‘.$page->ID, ‘before_widget’ => ‘<div id=”%1$s” … Read more
Check if your theme is compatible with WP 3.3. To check, you may try switching to the default theme (twentyeleven) for a moment by renaming your current theme’s folder in wp-content/themes. The idea is to force WordPress to fall back to the default theme to rule out any theme-specific issue. -also, make sure all your … Read more