How to create a post template with two sidebars

If you add sidebar-sidebaraleatorio.php and sidebar-sidebarrecomenda.php sidebar templates to your (child) theme directory, you can then call them with get_sidebar() function. Like so get_sidebar(‘sidebaraleatorio); and get_sidebar(‘sidebarrecomenda);. You can read more about sidebars from the Developer Handbook > Sidebars.

Dynamic sidebar rendered in another place than i would like

You shouldn’t save dynamic_sidebar in a variable because it always echoes out the widget. the following should work. <?php echo ‘<div class=”row-container”> <div class=”row row-parent’ . $row_classes . $limit_content_width . ‘”> <div class=”row-inner”>’; if(($layout === ‘sidebar_right’) && is_active_sidebar( ‘sidebar-messages-single’ )) { dynamic_sidebar( ‘sidebar-messages-single’ ); } echo ‘<div class=”col-lg-‘ . $sidebar_size . ‘”> <div class=”uncol style-‘ … Read more

Best practice for including plugin output in a template without using shortcode?

<?php // A) // inside your template if ( function_exists( ‘the_attachment_stuff()’ ) ) { // do stuff } // better/faster if ( class_exists( ‘attachment_plugin_class’ ) ) { // do stuff } // B) // inside your template do_action( ‘the_attachment_suff’); // means setting this inside your plugin // this avoids throwing errors or aborting if the … Read more

How to send data to sidebar?

You can edit the sidebar.php (or any sidebar-xxx.php file, depends on your theme) and interface with your database using the wpdb class. If your historical events are in the same DB as wordpress you can use the wpdb class straight away, if they are in another DB you can instanciate a new wpdb class with … Read more

Dynamic Sidebar and XHTML Validity?

I’ve had similar issues in the past with custom sidebars. It was caused by the improper use of the <ul> and <li> tags. I was adding them in the sidebar.php file and not inside the function. Now I use this code and with 6 active widgets I have no errors. Take a look at the … Read more

Sidebar widget not displaying after simple code update.

If you don’t need the others settings from register_sidebar, that’s fine. That’s not fine. 🙂 To render your sidebar you need to call dynamic_sidebar($index); In your case it would be: dynamic_sidebar(‘Right Sidebar’); see the codex page for dynamic sidebar http://codex.wordpress.org/Function_Reference/dynamic_sidebar Your current code says (short version): If there is no sidebar, then do my custom … Read more

How Do I Display A Custom Field In The Sidebar Of All My Pages?

I checked the code in the repository, and this specific function doesn’t have an ID parameter, meaning that it only grabs the CF of the current post/page being displayed. A fast solution would be: $my_page = get_page_by_path( ‘my-page’ ); $meta_values = get_post_meta($my_page->ID, ‘custom-field-name’, true); Maybe the plugin has another function for that, but you’d better … Read more

register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead

From your title: register_sidebar_widget() is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. Somewhere in your Theme – in functions.php, or in a function included within functions.php – you’re adding custom Widgets. Look for that code, and replace usage of register_sidebar_widget() with wp_register_sidebar_widget(). PROTIP: Use the Log Deprecated Notices Plugin to track down where the deprecated … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)