[Solved] Using get_theme_mod with checkbox to display content

Here is a modified version of your original code. Your echo statement isn’t right and really isn’t necessary. It’s probably better to jump out of PHP like I’ve done in the code below. Also, the unnecessary else statement was removed: <?php $servicescontent = get_theme_mod( ‘services-page’, 1 ); $abc = get_theme_mod( ‘services-check’, 1 ); $mod = … Read more

[Solved] Removing the default sidebar from admin panel

If you mean the default WordPress Widgets, you would add this to the functions.php file: <?php // unregister all default WP Widgets function unregister_default_wp_widgets() { unregister_widget(‘WP_Widget_Pages’); unregister_widget(‘WP_Widget_Calendar’); unregister_widget(‘WP_Widget_Archives’); unregister_widget(‘WP_Widget_Links’); unregister_widget(‘WP_Widget_Meta’); unregister_widget(‘WP_Widget_Search’); unregister_widget(‘WP_Widget_Text’); unregister_widget(‘WP_Widget_Categories’); unregister_widget(‘WP_Widget_Recent_Posts’); unregister_widget(‘WP_Widget_Recent_Comments’); unregister_widget(‘WP_Widget_RSS’); unregister_widget(‘WP_Widget_Tag_Cloud’); unregister_widget(‘WP_Nav_Menu_Widget’); } add_action(‘widgets_init’, ‘unregister_default_wp_widgets’, 1); ?> EDIT: register_sidebar(array(‘name’=>’sidebar2’, ‘before_widget’ => ‘<ul><li>’, ‘after_widget’ => “</li></ul>”, ‘before_title’ => ‘<h2 class=”widgettitle”>’, … Read more

[Solved] display public excerpt for private post

I’ve not tested this, but you should be able to complete this task by placing the following code in your template above the loop. query_posts( array( ‘post_status’ => array( ‘published’, ‘private’ ) ) ); This should allow for published and private posts to be displayed in that template. 4 solved display public excerpt for private … Read more

[Solved] Most efficient way to get custom database records from 20 buttons and 20 tables?

I suppose the easiest way would be to have the action or other parameters in the button itself, i.e. <div class=”mybutton” data-action=”get_quote” data-type=”literary”>Get a literary quote</div> <div class=”mybutton” data-action=”get_quote” data-type=”political”>Get a political quote</div> data-foo=”bar” attributes can easily be accessed in jQuery with .data(“foo”), so you could change the jQuery around a bit to listen to … Read more

[Solved] Between functions.php (theme), widgets, and plugins, which is loaded first?

The plugins are loaded right before theme (yes, I’ve been looking for excuse to use this): However it is wrong to think about either as point of code execution. For most cases everything should be hooked and executed no earlier than init hook. According to Codex widget registration with register_widget() should be hooked to widget_init. … Read more