Title: DevDm's Replies - page 3 | WordPress.org

---

# DevDm

  [  ](https://wordpress.org/support/users/devdm/)

 *   [Profile](https://wordpress.org/support/users/devdm/)
 *   [Topics Started](https://wordpress.org/support/users/devdm/topics/)
 *   [Replies Created](https://wordpress.org/support/users/devdm/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/devdm/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/devdm/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/devdm/engagements/)
 *   [Favorites](https://wordpress.org/support/users/devdm/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 31 through 45 (of 68 total)

[←](https://wordpress.org/support/users/devdm/replies/page/2/?output_format=md) 
[1](https://wordpress.org/support/users/devdm/replies/?output_format=md) [2](https://wordpress.org/support/users/devdm/replies/page/2/?output_format=md)
3 [4](https://wordpress.org/support/users/devdm/replies/page/4/?output_format=md)
[5](https://wordpress.org/support/users/devdm/replies/page/5/?output_format=md) 
[→](https://wordpress.org/support/users/devdm/replies/page/4/?output_format=md)

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[DevDmBootstrap3] Adding drop-downs to Options](https://wordpress.org/support/topic/tab-dropdowns-cannot-be-clicked-1/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/tab-dropdowns-cannot-be-clicked-1/#post-5300491)
 * This isn’t so much a support question as it is a WordPress how to but I’ll help
   anyway. 🙂
 * Rather than edit the right column lets just add a new dropdown option.
 * We are working in the theme-options.php file. If you are going to go this far
   you might re-brand the whole theme for yourself so that any future updates I 
   make don’t wipe out this for you.
 * **Step 1)** add the new option to the $dm_options array and give it a default
   value.
 *     ```
       $dm_options = array(
           'author_credits' => true,
           'right_sidebar' => true,
           'right_sidebar_width' => 3,
           'left_sidebar' => true,
           'left_sidebar_width' => 3,
           'show_header' => true,
           'show_postmeta' => true,
           'new_dropdown' => 'select'
       );
       ```
   
 * **Step 2)** define some values for this new drop down
 *     ```
       $dm_new_dropdown_options = array(
           '1' => array (
               'value' => 'select',
               'label' => 'select'
           ),
           '2' => array (
               'value' => 'option1value',
               'label' => 'option 1 label'
           ),
           '3' => array (
               'value' => 'option2value',
               'label' => 'option 2 label'
           ),
           '4' => array (
               'value' => 'option3value',
               'label' => 'option 3 label'
           ),
           '5' => array (
               'value' => 'option4value',
               'label' => 'option 4 label'
           )
       );
       ```
   
 * **Step 3)** We are going to add some code inside the devdm_theme_options function
   now.
 * First add the variable we created above of possible drop down options to the 
   global line at the top of the function.
 *     ```
       //get our global options
           global $dm_options, $dm_sidebar_sizes,$dm_new_dropdown_options, $developer_uri;
       ```
   
 * Second we are going to add the code that generates the html and sets the selected
   value.
 * I put this inside the <form and inside the first table tag. It makes a new table
   row with cells and sets up the html of our select box.
 *     ```
       <tr valign="top"><th scope="row"><?php _e('New Drop Down Options','devdmbootstrap3') ;?></th>
                           <td>
                               <select id="new_options" name="dm_options[new_dropdown]">
                                   <?php foreach( $dm_new_dropdown_options as $new_options ) :
                                       $label = $new_options['label'];
                                       $selected = '';
                                       if ( $new_options['value'] == $settings['new_dropdown'] )
                                           $selected = 'selected="selected"';
                                       echo '<option style="padding-right: 10px;" value="' . esc_attr( $new_options['value'] ) . '" ' . $selected . '>' . $label . '</option>';
                                   endforeach; ?>
                               </select>
   
                           </td>
                       </tr>
       ```
   
 * At this point it should probably be fine and working if you go to the DevDm Theme
   Options page but there is no security here. So lets do that now because we care
   about our users and it is our responsibility to save them from the evil of the
   internet.
 * **With great power… etc. and so forth… responsibility. **
 * **Step 4)** We are going to move up into the dm_validate_options function now.
 * Add your $dm_new_dropdown_options to the global line like we did with the devdm_theme_options
   function.
 * Insert the code below anywhere after the $settings variable is set and before
   the return $input at the bottom
 * The code below first sets a $prev variable to the OLD value before you changed
   it.
 * Now we set a holder variable that already says your input is bad.
 * It has to pass our test before we give it free passage to the database.
 * Next we loop through the available options checking for an exact match to your
   change the options page has passed through. If we find one we set the holder 
   variable to true and it saves itself. If the holder variable is still false by
   the time it gets to our last if statement we override the $input and set it to
   the old value as it could have been something bad.
 *     ```
       $prev = $settings['new_dropdown'];
           $new_dropdown_valid = false;
   
           foreach ($dm_new_dropdown_options as $key => $new_dropdown_option) {
               if ($input['new_dropdown'] === $new_dropdown_option['value']) {
                   $new_dropdown_valid = true;
               }
           }
   
           if ( $new_dropdown_valid == false ) {
               $input['new_dropdown'] = $prev;
           }
       ```
   
 * That should be it! Now you can control the “new_dropdown” value inside the $dm_options.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[DevDmBootstrap3] Posts in grid or masonry](https://wordpress.org/support/topic/posts-in-grid-or-masonry/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/posts-in-grid-or-masonry/#post-5219741)
 * This can be accomplished but it isn’t something to really be explained with a
   simple support request. This is a full featured request that a developer needs
   to build. Everything from configuring your masonry execution to structuring the
   posts container/elements will have to be taken into account.
 * It might be much easier for you and less headache to use a plugin.
 * [https://wordpress.org/plugins/tags/masonry](https://wordpress.org/plugins/tags/masonry)
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[DevDmBootstrap3] grunt config](https://wordpress.org/support/topic/grunt-config/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/grunt-config/#post-5165406)
 * I’m not using Grunt exius. You might be able to pull some info from the bootstrap
   repository for it and incorporate my less configuration with it.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[DevDmBootstrap3] Set up template drop down?](https://wordpress.org/support/topic/set-up-template-drop-down/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/set-up-template-drop-down/#post-5151832)
 * Timothy is right Michelle.
 * I made a forum topic about this
 * [http://devdm.com/DevDmBootstrap3/community/topic/page-template-to-only-show-the-right-side-bar/](http://devdm.com/DevDmBootstrap3/community/topic/page-template-to-only-show-the-right-side-bar/)
 * You can view the code for creating the template page to only show a right sidebar.
 * The childtheme ‘cleanblog’ also as examples of left/right/fullwidth page templates.
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[DevDmBootstrap3] Great Bootstrap Parent Theme](https://wordpress.org/support/topic/great-bootstrap-parent-theme/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/great-bootstrap-parent-theme/#post-7870477)
 * Hey thanks Trishahdee!
 * I just set up bbpress on the [theme website](https://wordpress.org/support/users/devdm/replies/page/3/trishahdee?output_format=md).
   We have a showcase area. Maybe you can post some of your work there.
 * [http://devdm.com/DevDmBootstrap3/community/](http://devdm.com/DevDmBootstrap3/community/)
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[DevDmBootstrap3] Left sidebar is showing on the top of the content in portrait and mobile view](https://wordpress.org/support/topic/left-sidebar-is-showing-on-the-top-of-the-content-in-portrait-and-mobile-view/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/left-sidebar-is-showing-on-the-top-of-the-content-in-portrait-and-mobile-view/#post-5028724)
 * Sure Azi.
 * To solve this problem you can use jQuery to “reorder the divs.”
 * Here is a stackoverflow about how to do it.
 * Basically you will write a script that detects the window/screen size and then
   executes this “reordering.”
 * Hope this helps.
 * [http://stackoverflow.com/questions/10088496/jquery-reorder-divs](http://stackoverflow.com/questions/10088496/jquery-reorder-divs)
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[DevDmBootstrap3] Boostraps 3 Starter Theme Rules.](https://wordpress.org/support/topic/boostraps-3-starter-theme-rules/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/boostraps-3-starter-theme-rules/#post-7854547)
 * You are welcome Jenni. I hope it brings you much success! 🙂
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[DevDmBootstrap3] Perfect for Devs Without the Bloat](https://wordpress.org/support/topic/perfect-for-devs-without-the-bloat/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/perfect-for-devs-without-the-bloat/#post-7851689)
 * Thank you for the kind words nosker!
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[DevDmBootstrap3] how to have drop down on hover for main menu](https://wordpress.org/support/topic/how-to-have-drop-down-on-hover-for-main-menu/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [12 years ago](https://wordpress.org/support/topic/how-to-have-drop-down-on-hover-for-main-menu/#post-4869955)
 * Hey Pipedragon!
 * I actually wrote a bit of jQuery to handle this.
 * jQuery(document).ready(function ($) {
 *  //only enable drop down hover when the mobile menu isn’t displayed
    var $window
   = $(window);
 *  function checkWidth() {
    var windowsize = $window.width(); if (windowsize > 
   767) {
 *  $(‘.dmbs-top-menu .navbar-inverse .navbar-nav li’).mouseenter(function(){
    $(‘
   ul’,this).stop().slideDown(); });
 *  $(‘.dmbs-top-menu .navbar-inverse .navbar-nav li’).mouseleave(function(){
    $(‘
   ul’,this).stop().slideUp(); }); } } // Execute on load checkWidth(); // Bind 
   event listener $(window).resize(checkWidth);
 * });
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[DevDmBootstrap3] Great theme: lots of flexibility without complications](https://wordpress.org/support/topic/great-theme-lots-of-flexibility-without-complications/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/great-theme-lots-of-flexibility-without-complications/#post-7840283)
 * Thank for the support Chicchera! Hopefully it helps you out.
 * You are right about the conditionals for the custom functions. I will make a 
   note to add them in the next update.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[DevDmBootstrap3] Adding a container Div around dropdown menu](https://wordpress.org/support/topic/adding-a-container-div-around-dropdown-menu/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/adding-a-container-div-around-dropdown-menu/#post-4726002)
 * Closed.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[DevDmBootstrap3] Adding a container Div around dropdown menu](https://wordpress.org/support/topic/adding-a-container-div-around-dropdown-menu/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/adding-a-container-div-around-dropdown-menu/#post-4725833)
 * Let me know what you come up with 🙂 I’ll be curious.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[DevDmBootstrap3] Adding a container Div around dropdown menu](https://wordpress.org/support/topic/adding-a-container-div-around-dropdown-menu/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/adding-a-container-div-around-dropdown-menu/#post-4725830)
 * I see what you are after here and honestly I’ve not encountered this request 
   before so it is new on me.
 * I’m digging into the nav-walker to see if I can get you a solution but I’m out
   of time for today.
 * Here is a link to the github project. The author is a really cool guy and could
   probably answer this quickly for you.
 * [https://github.com/twittem/wp-bootstrap-navwalker](https://github.com/twittem/wp-bootstrap-navwalker)
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[DevDmBootstrap3] Adding a container Div around dropdown menu](https://wordpress.org/support/topic/adding-a-container-div-around-dropdown-menu/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/adding-a-container-div-around-dropdown-menu/#post-4725817)
 * Hey Chris,
 * I think you went the hard way on that one.
 * You want the navbar below the header to span the length of the page? Do I have
   that right?
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[DevDmBootstrap3] How to move time and author from post meta](https://wordpress.org/support/topic/how-to-move-time-and-author-from-post-meta/)
 *  Theme Author [DevDm](https://wordpress.org/support/users/devdm/)
 * (@devdm)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/how-to-move-time-and-author-from-post-meta/#post-4692181)
 * Oh in that case it is easier.
 * Add the “navbar-static-top” to the <nav > element.
 * Open that index.php file and switch the position of these two:
 * <?php get_template_part(‘template-part’, ‘head’); ?>
 * <?php get_template_part(‘template-part’, ‘topnav’); ?>
 * So the topnav will be first.
 * <?php get_template_part(‘template-part’, ‘topnav’); ?>
 * <?php get_template_part(‘template-part’, ‘head’); ?>
 * You’ll need to do this for page.php too!

Viewing 15 replies - 31 through 45 (of 68 total)

[←](https://wordpress.org/support/users/devdm/replies/page/2/?output_format=md) 
[1](https://wordpress.org/support/users/devdm/replies/?output_format=md) [2](https://wordpress.org/support/users/devdm/replies/page/2/?output_format=md)
3 [4](https://wordpress.org/support/users/devdm/replies/page/4/?output_format=md)
[5](https://wordpress.org/support/users/devdm/replies/page/5/?output_format=md) 
[→](https://wordpress.org/support/users/devdm/replies/page/4/?output_format=md)