Tom Carney
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Sanitizing a checkboxFor 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: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
In reply to: Adding a conditional if a check box is checkedSaved here: https://pastebin.com/gsquyas2
Forum: Developing with WordPress
In reply to: Adding a conditional if a check box is checkedHi 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
Let me know if you have any questions.Forum: Plugins
In reply to: [Custom Query Blocks] Order By – RandomThank you for the heads on the random with the pagination. Great work on the plugin.
Forum: Themes and Templates
In reply to: [Mantra] Disable Main Navigation On A Single PageI 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://ww.wp.xz.cn/support/topic/hide-menu-on-one-page-only/Good Luck and have a great day.
Forum: Themes and Templates
In reply to: [The Box] Create Blank Page TemplateForum: Themes and Templates
In reply to: [Franz Josef] Social IconsHello
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
In reply to: [SG Window] Contact Page CustomizeHello,
I would recommend a plugin like 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
In reply to: header resizeHello,
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.
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
In reply to: Custom css and Changed Menu bar colourHi,
In the custom.css file or theme option – you need to add background-color:
ul#nav { background-color: #4B4191; }Forum: Themes and Templates
In reply to: How do I remove the generic footer?In footer.php, you want to remove the code that starts like this:
<a href="<?php echo esc_url( __( 'https://ww.wp.xz.cn/'By removing or editing that code you will change your footer text.