Dynamic Sidebars based on page name
Something like this should work: if( is_page() ) : $this_page = get_queried_object(); if ( ! dynamic_sidebar( $this_page->post_title ) ) : echo ‘No sidebar defined for this page title’; endif; endif;
Something like this should work: if( is_page() ) : $this_page = get_queried_object(); if ( ! dynamic_sidebar( $this_page->post_title ) ) : echo ‘No sidebar defined for this page title’; endif; endif;
Here is some code that reads the highest number from the user meta table and then adds +1 to that number. This saves that number for each newly registered user. The code is triggered via the action hook “user_register”. add_action( ‘user_register’, ‘assignuserid’); function assignuserid($user_id) { global $wpdb; $latestid=$wpdb->get_var(“SELECT meta_value from $wpdb->usermeta where meta_key=’memnumber’ order by … Read more
This was not WPAlchemy problem. It was a matter of running a custom query. Some vital information about current post, like ID of the post I was editing got lost.
I’m assuming that you want to have a home page with it’s own content and then the blog to be elsewhere on your site. What you want to do is create a Page Template. Call it Home Page Template or something like that and you can make the file whatever you’d like – maybe template-homepage.php. … Read more
<?php /* Template Name:product */ get_header(); // check if product_id is not set or is empty string if( !isset($_GET[‘product_id’]) || ” == $_GET[‘product_id’] ) { // if so, run your query and display data $data = $wpdb->get_results(“myquery Here”); foreach($data as $row) { echo ‘<div>’; echo ‘<p>Name:’ . $row->p_name . ‘</p>’; echo ‘<p>Price:’ . $row->p_price. ‘</p>’; … Read more
I am using this plugin since a day and I noticed too, seems it is a bug. All you have to do is to choose another meta type in the list, then select the previous type again. And the field is enabled ! Now, I try to understand, if it is possible, how to give … Read more
Ok. M-R is right about using the full paths and not relative URLs. Make sure to do that. Create a page from wp-admin->Pages named whatever you want. The title will be used to construct the URL so choose carefully Assign this page to your template “Tarot” The page should be accessible, but to everyone, logged … Read more
Register the post type without a UI (‘show_ui’=>false), then you will have to to create a form on your submenu page(s) and one or more handlers for those forms. wp_insert_post/wp_update_post can handle the post insertion if you give them the right information. Based on the information available, that is the best I’ve got. For a … Read more
Just call remove_section method of the $wp_customize object: add_action( ‘customize_register’, ‘wpse8170_customize_register’ ); function wpse8170_customize_register( WP_Customize_Manager $wp_customize ) { $wp_customize->remove_section( ‘section-id-to-remove’ ); }
It’s because the TwentyTwelve theme has “clear: both;” set on H3 tags, which messes up the layout. Try adding this CSS: #authorlist h3 { clear: none !important; }