Title: Tom Carney's Replies | WordPress.org

---

# Tom Carney

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

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

 Search replies:

## Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)

 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Sanitizing a checkbox](https://wordpress.org/support/topic/sanitizing-a-checkbox/)
 *  [Tom Carney](https://wordpress.org/support/users/tecdoc/)
 * (@tecdoc)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/sanitizing-a-checkbox/#post-18212914)
 * For checkboxes, you should use `sanitize_key()` instead since checkbox values
   are typically simple on/off values. Here’s the correct way to sanitize a checkbox
   in the user meta update:
 *     ```wp-block-code
       update_user_meta( $user_id, '6_checkbox', sanitize_key( $_POST['6_checkbox'] ) );
       ```
   
 * This works better because sanitize_key() is designed for simple values and will:
    - Convert to lowercase
    - Remove all non-alphanumeric characters
    - Perfect for checkbox values that are typically ‘1’, ‘on’, or empty
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Adding a conditional if a check box is checked](https://wordpress.org/support/topic/adding-a-conditional-if-a-check-box-is-checked/)
 *  [Tom Carney](https://wordpress.org/support/users/tecdoc/)
 * (@tecdoc)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/adding-a-conditional-if-a-check-box-is-checked/#post-18212912)
 * Saved here: [https://pastebin.com/gsquyas2](https://pastebin.com/gsquyas2)
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Adding a conditional if a check box is checked](https://wordpress.org/support/topic/adding-a-conditional-if-a-check-box-is-checked/)
 *  [Tom Carney](https://wordpress.org/support/users/tecdoc/)
 * (@tecdoc)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/adding-a-conditional-if-a-check-box-is-checked/#post-18212691)
 * Hi sacconi,
 * First I would add the variable:
   `**$checkbox_status** = get_post_meta($post->
   ID, '6_checkbox', true);`For this line of code:`if ( ! empty( trim( $discount_post))**&&!
   not checked the check box:"6_checkbox"**)) {`I would edit it to make it look 
   like this:`if ( ! empty( trim( $discount_post ) ) **&& empty($checkbox_status))**{`
   here is the full code:[https://pastebin.com/gsquyas2](https://pastebin.com/gsquyas2)
   Let me know if you have any questions.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Query Blocks] Order By – Random](https://wordpress.org/support/topic/order-by-random-6/)
 *  Thread Starter [Tom Carney](https://wordpress.org/support/users/tecdoc/)
 * (@tecdoc)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/order-by-random-6/#post-12394153)
 * Thank you for the heads on the random with the pagination. Great work on the 
   plugin.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Mantra] Disable Main Navigation On A Single Page](https://wordpress.org/support/topic/disable-main-navigation-on-a-single-page/)
 *  [Tom Carney](https://wordpress.org/support/users/tecdoc/)
 * (@tecdoc)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/disable-main-navigation-on-a-single-page/#post-8133856)
 * I used this CSS on Chrome inspector to take the main navigation menu tabs on 
   that page:
 *     ```
       .page-id-3427 nav#access {
           display: none;
       }
       ```
   
 * Take a look at this url – has further instructions on how to do this properly.
   
   [https://wordpress.org/support/topic/hide-menu-on-one-page-only/](https://wordpress.org/support/topic/hide-menu-on-one-page-only/)
 * Good Luck and have a great day.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[The Box] Create Blank Page Template](https://wordpress.org/support/topic/create-blank-page-template/)
 *  [Tom Carney](https://wordpress.org/support/users/tecdoc/)
 * (@tecdoc)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/create-blank-page-template/#post-6562853)
 * Hello:
 * Here is the [link](https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/)
   to help you setup a page template within your theme.
 * Good Luck.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Franz Josef] Social Icons](https://wordpress.org/support/topic/social-icons-59/)
 *  [Tom Carney](https://wordpress.org/support/users/tecdoc/)
 * (@tecdoc)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/social-icons-59/#post-6560819)
 * Hello
    If it is in the file code it would be this: `<i class="fa fa-facebook"
   ></i>` to `<i class="fa fa-facebook-square"></i>`
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[SG Window] Contact Page Customize](https://wordpress.org/support/topic/contact-page-customize/)
 *  [Tom Carney](https://wordpress.org/support/users/tecdoc/)
 * (@tecdoc)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/contact-page-customize/#post-6562390)
 * Hello,
 * I would recommend a plugin like [Dynamic Widgets](https://wordpress.org/plugins/dynamic-widgets/)–
   it will allow you to display the Google Maps widget only in the Contact Us page
   only. Good luck.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [header resize](https://wordpress.org/support/topic/header-resize-2/)
 *  [Tom Carney](https://wordpress.org/support/users/tecdoc/)
 * (@tecdoc)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/header-resize-2/#post-6562386)
 * Hello,
    Is this theme using a customizer element for the header settings? I don’t
   have access to the theme’s admin area to tell. If it is not, you want to use 
   this CSS element in the style.css:
 *     ```
       .header-wrapper {
           text-align: center;
           width: 100%;
           position: fixed;
           z-index: 3;
           /* adjust the padding top and bottom to reduce the header's height */
           padding-top: 60px;
           padding-bottom: 25px;
           float: left;
           background: transparent;
       }
       ```
   
 * Good luck.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PublishPress Permissions: Control User Access for Posts, Pages, Categories, Tags] Redirecting users from groups to the group protected page](https://wordpress.org/support/topic/redirecting-users-from-groups-to-the-group-protected-page/)
 *  Thread Starter [Tom Carney](https://wordpress.org/support/users/tecdoc/)
 * (@tecdoc)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/redirecting-users-from-groups-to-the-group-protected-page/#post-6484466)
 * Tried your code but didn’t redirect properly to the specific page:
 * Here is the code that I tried, was using the function pp_get_groups_for_user 
   from api_pp.php:
 *     ```
       function my_login_redirect( $redirect_to ) {
         //is there a user to check?
         global $current_user;
         $groups= pp_get_groups_for_user($current_user->ID, 'pp_group');
         // var_dump($groups);
          // Beaumont Member redirect to the bcm member page
           if ( in_array( '12', $groups ) ) {
               //redirect them to the default place
                 return (get_home_url().'/bcm-member-strategy');
               }  
   
            elseif
           // Fidelity Member redirect to the fidelity member page
           ( in_array( '13', $groups ) ) {
             // redirect them to the default place
             return (get_home_url().'/bcm-fidelity-strategies');
           }
        else {
         return $redirect_to;
        }
   
       }
       add_filter( 'login_redirect', 'my_login_redirect');
       ```
   
 * if you check if I am using the function properly or which function I should use
   to get the redirection working.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Custom css and Changed Menu bar colour](https://wordpress.org/support/topic/custom-css-and-changed-menu-bar-colour/)
 *  [Tom Carney](https://wordpress.org/support/users/tecdoc/)
 * (@tecdoc)
 * [11 years ago](https://wordpress.org/support/topic/custom-css-and-changed-menu-bar-colour/#post-6242259)
 * Hi,
 * In the custom.css file or theme option – you need to add background-color:
 *     ```
       ul#nav {
       background-color: #4B4191;
       }
       ```
   
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How do I remove the generic footer?](https://wordpress.org/support/topic/how-do-i-remove-the-generic-footer/)
 *  [Tom Carney](https://wordpress.org/support/users/tecdoc/)
 * (@tecdoc)
 * [11 years ago](https://wordpress.org/support/topic/how-do-i-remove-the-generic-footer/#post-6242226)
 * In footer.php, you want to remove the code that starts like this:
    `<a href="
   <?php echo esc_url( __( 'https://wordpress.org/'`
 * By removing or editing that code you will change your footer text.

Viewing 12 replies - 1 through 12 (of 12 total)