Displaying shortcode content inside custom field without images
No need to deal with the content, use the do_shortcode function directly on your metadata: echo do_shortcode( $your_meta_data );
No need to deal with the content, use the do_shortcode function directly on your metadata: echo do_shortcode( $your_meta_data );
Test the value before you use it: <?php if ( ! $img = get_field(‘img_actor’, get_the_ID() ) ) $img = ‘http://www.example.com/wp-content/uploads/default.jpg’; ?> <img class=”film” src=”https://wordpress.stackexchange.com/scripts/timthumb.php?src=<?php echo urlencode($img); ?>&h=251&w=175&zc=1″ alt=”<?php the_title_attribute(); ?>” title=”<?php the_title_attribute(); ?>”/> I recommend not to use the same text for title and alt, this is very annoying for screen reader users.
I cannot be 100% sure since I can’t test without installing and running you code but I think the problem is that you aren’t echoing your selected markup. <option <?php selected( get_post_meta($post->ID, ‘cpi_dropdown_options’, true), ‘Option 1′, true ); ?>>No</option> The last parameter tells selected to echo output. Edit: Your options aren’t sending a value. Compare … Read more
I don’t know why this issue occurs. The back_link is created in /wp-includes/functions.php. If there were a Javascript solution, it could be applied in the message of wp_die. For example: $msg = ‘Error’ . “\n<p><a href=”https://wordpress.stackexchange.com/questions/80375/javascript:history.go(-1)”>$back_text</a></p>”; wp_die($msg, ‘Error’, array( ‘response’ => 500 )); But this didn’t work… What I saw is that the Title and … Read more
what you could do is: 1. get the list of all posts currently on the page 2. grab all the IDs of the posts 3. do the following query: SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = ‘product_brand’ AND post_id IN (3,9,10,15) ORDER BY meta_value; where 3,9,10,15 are post ids that you’ve collected.
For this to work you need the date stored in the database to match the $todaysDate and it probably doesn’t. If I am reading your somewhat confusing question correctly then you are storing dates like 20th Jan 2013 but you are matching it against a date that looks like 0120 (January 20). Even if you … Read more
Check in your function to save the post meta data for the post type or better for $current_screen. The var is a global and return a object with different identifier to check, in which admin page init the function. Check in your function and return if is not the right $current_screen->id or post_type. Small hint: … Read more
I’m sure it’s possible, but will require some work with both PHP and jQuery. This plugin by Thomas Griffin to insert an image into a meta box would be a very good starting point. You’ll need to do some digging around in the js files in wp-admin/js and in wp-admin/includes/media.php.
You already have $post object on image.php. Don’t complicate and use following: <?php echo get_post_meta($post->ID, ‘my-custom-field’, true); echo $post->post_parent;
If you have billing_phone as user meta, which is the preferred way, that query would be incorrect. The advantage of utilizing custom user meta and adding a field for billing_phone would allow you to use get_users(). $user = get_users(‘meta_key’ => ‘billing_phone’, ‘meta_value’ => $phone_number, ‘fields’ => ‘ID’); The above would give you an array of … Read more