is there away to hide php code in wordpress not to show in PAGES
Finally Working. I used this if (is_singular(‘post’)) { // your code after this line or comment }
Finally Working. I used this if (is_singular(‘post’)) { // your code after this line or comment }
$birthday_ts = strtotime( get_field(‘dob’) ); $now = current_time( ‘timestamp’ ); $years = intval( ( $now – $birthday_ts ) / YEAR_IN_SECONDS ); $months = intval( ( $now – $birthday_ts ) / MONTH_IN_SECONDS ); $weeks = intval( ( $now – $birthday_ts ) / WEEK_IN_SECONDS ); $days = intval( ( $now – $birthday_ts ) / DAY_IN_SECONDS ); $hours … Read more
Something like this should work though I havent testested it: PHP: <?php $inputs=”<ul class=”checkbox-columns”>”; foreach($subjects as $subject){ $inputs .= ‘<li><label><input type=”checkbox” name=”subjects[]” value=”‘ . $subject[‘subject’] . ‘”/>’ . $subject[‘subject’] . ‘</label></li>’; } $inputs .= ‘</ul>’; echo $inputs; CSS: .checkbox-columns { width: 200px; } .checkbox-columns li { display: block; float: left; width: 50%; } This creates … Read more
Technically, it’s possible. And it works. You could have a PHP site on a sub-directory like example.com/shop. But, a better practice is to host that PHP site on a sub-domain like shop.example.com. It helps in better maintenance and provides a better structure for organizing the site. On a Nginx server, your config should be something … Read more
Well, the error says exactly what’s going on. You’re outputting content, before the data is finished being manipulated. It’s like you’re trying to echo something but WordPress still has to do some stuff and it’s telling you “No, no, let me do my thing first”. You’re calling the echo too early. In short, you’re 99% … Read more
Many plugins have an ’empty’ index.php that doesn’t do anything; the plugin code is elsewhere. But you need to contact the plugin’s author/support to get a definitive answer.
Whenever you use a value from an array, like $array[‘key’] where it’s possible that the ‘key’ doesn’t exist (such as the first time a widget is used) you need to check that it exists before using it or you’ll get errors on those occasions where it hasn’t been set. Your problem is that when the … Read more
-Create a shortcode in wordpress displaying select box with options generated. You can get some ideas from here -now just put new shortcode into contact form Should work well this way
In SQL statement use placeholders instead of variable: %s (string) or %d (number). The second argument of prepare() is array of variables to substitute into the placeholders. $skill_select = $wpdb->get_results( $wpdb->prepare(” SELECT skill_name, char_id, um_id, c.class_id FROM `wp_ml_skill_class` sc JOIN `wp_ml_skill` s ON (s.skill_id = sc.skill_id) JOIN `wp_ml_character` c WHERE c.class_id = %d AND c.char_id … Read more
Looking at the snippet you provided the solution seems to be your last solution. $emails = array( $email, ‘[email protected]’,’[email protected]’ ); Sending an array of emails, the first one ($email) being the dynamic email. The second and third would be hard coded values. This is assuming the email handler is ready to accept an array of … Read more