Use a Variable in update_post_meta as the $meta_key
There is an error in setting variable on this line: $week_s1=”_member_score_”.$week._s1″; this line should be $week_s1 =”_member_score_”.$week.”_s1″;
There is an error in setting variable on this line: $week_s1=”_member_score_”.$week._s1″; this line should be $week_s1 =”_member_score_”.$week.”_s1″;
Never mind. I found a version of Magic Fields that supports custom post types. You can find it here: https://github.com/attitude/Magic-Fields It looks like it is just a mod on Magic Fields to allow custom post types. And it works good so far
Your core problem is that you are using two shortcodes. shortcodes are not a programing language and should not be used as such. Shortcode should generate HTML in a consistent self contained way. If a shortcode A can not work without having shortcode B in the content as well, it is a sign you are … Read more
You could return the data and set a local variable: function get_album_info() { $album = array( ‘art’ => wp_get_attachment_image_src( get_sub_field(‘album_art’), ‘full’ ), ‘date’ => get_field(‘album_date’) ); return $album; } $album = get_album_info(); echo $album[‘art’]; echo $album[‘date’];
This is actually a PHP question, and not a WordPress question. The issue is that global variables don’t pass through the include()/require() call from the template file into header.php. The solution is to define $data after you globalize it. Without knowing your options framework or your Theme specifically, I can only answer in general terms; … Read more
In PHP, 0 == false == [] == ” == null. A simple check to check if a variable or condition has a value will return false if the value is equal to 0. For 0 to return true as a valid value, you would need to make use of strict comparison by using the … Read more
Ok, so somehow I got it working by changing it to this: It looks like it didn’t like ‘the_clientId’. Maybe it just doesn’t like capital letters???? [insert-form form_location=”form.php” identification_number=”12345″] function insert_the_form($atts){ $form_base = plugin_dir_path(__DIR__); // Shortcode attributes & options $atts = shortcode_atts( array( ‘form_location’ => ‘NULL’, ‘identification_number’ => ‘NULL’ //Variable for client ID ), $atts, … Read more
$attachments holds array of posts, you are missing something like: $attachment = $attachments[0]; or foreach( $attachments as $attachment ) Update Nope, like this: foreach( $attachments as $attachment ) if ($attachment->post_title == $programme) { echo the_attachment_link($post->ID, false); break; }
It the template is called via get_template_part(), then it is in a new variable scope. to access it, you have to use the global keyword in you template file: global $foo; echo $foo; As header.php probalbly is also called in a function scope, you have to make sure there the variable is used in global … Read more
Please simply place commonJs var outside the jQuery function and try again. It will work for you.