Basics: adding template tag to display custom fields in the post
you should add <?php the_meta(); ?> in your single.php or in other relevant file. reference how to edit your theme files
you should add <?php the_meta(); ?> in your single.php or in other relevant file. reference how to edit your theme files
where are you setting $ecpt_challenge, $ecpt_solution and $ecpt_results? also get_post_meta($post->ID, ‘ecpt_goal’, false); returns an array, so use print_r ( get_post_meta($post->ID, ‘ecpt_goal’, false)); OR for single result pass “true” in the last argument. echo get_post_meta($post->ID, ‘ecpt_goal’, true); reference: get_post_meta() @codex
You can use the do_shortcode() function. do_shortcode(‘[your-shortcode option1=foo option2=bar]’); Or in your case: $price = get_post_meta($post->ID, ‘_price’, true); #Dynamically generate the plugin shortcode $new_price = do_shortcode(“[plugin-shortcode price=$price]”); Hope this helps you out!
I was able to do this with WPAlchemy and its function have_fields_and_multi(). It allows for adding an arbitrary number of sections (by means of an ‘Add New’ button), called groups, that can contain all the metadata I needed, including links to images which can be added using the Add Media dialog which was made easily … Read more
Is it really necessary to override default WordPress title filed? instead I’d recommend using a different meta key such as – my_the_title to store the title into database. And then use wordpress function – get_post_meta() to show it, instead of the_title() function.
I got custom fields working in the front end form linked in this post: How to use nonce with front end submission form? Here is the code used for the form page (custom page template): http://pastebin.com/YWyXL3jY Hopefully that will be of help to you with a bit of tweaking to use image URL’s instead of … Read more
args = array( ‘post_type’ => ‘product’, ‘meta_query’ => array( array( ‘key’ => ‘brand’, ‘value’ => ‘crocs’, ‘compare’ => ‘LIKE’ ) ) ); $query = new WP_Query( $args ); http://codex.wordpress.org/Class_Reference/WP_Query
Answering my own question, as suggested in my edit I’ve had to use the following meta_query array to query the posts: ‘meta_query’ => array( array( ‘key’ => ‘country’, ‘compare’ => ‘LIKE’, ‘value’ => ‘”‘ . get_the_ID() . ‘”‘ ) )
Debugging in WordPress The following could/should be set in the wp-config.php file of your local(!!) installation – never do this on a live site, especially not when you got caching activated! define( ‘WP_CACHE’, false ); // Show the development files for scripts/stylesheets and don’t combine them define( ‘COMPRESS_CSS’, false ); define( ‘SCRIPT_DEBUG’, true ); define( … Read more
wp_insert_attachment will insert an attachment post for a given parent post ID and filename. You can write a little script to query for all your posts with the legacy key, get their associated image paths, and call wp_insert_attachment for each.