Localized Date Format for Custom Field
actually I found the answer right after posting: date_i18n(get_option(‘date_format’) ,$timestamp); it was in an example here
actually I found the answer right after posting: date_i18n(get_option(‘date_format’) ,$timestamp); it was in an example here
There are probably a few ways to handle this. Here’s one way using a checkbox to enable the prefix for individual posts, and a filter on the_title to add the prefix whenever the_title() is called for those posts. 1. Add a meta box for an on/off checkbox a. Add the meta box to the post … Read more
You can alter your foreach loop as following to get concert date and city pair in single multidimentional array as following. $concert_query = array(); $i = 0; foreach($c_query as $post) : setup_postdata($post); $concert_query[$i][‘concert_date’] = get_post_meta(get_the_ID(), ‘concert_date’, true); $concert_query[$i][‘concert_city’] = get_post_meta(get_the_ID(), ‘concert_city’, true); $i ++; endforeach; print_r($concert_query);
This is just a basic php array question – not a WP question. function unique_authors ( $authors ) { $newArray = array(); foreach( $authors as $item ) { $itemArray = explode( “, “, $item ); $newArray = array_merge($newArray, $itemArray); } $newArray = array_unique($newArray); return $newArray; } $authors = unique_authors( $authors ); foreach( $authors as $author … Read more
This is a problematic idea. WordPress do not have any strong connectivity between an image (or any other uploaded file) and any content (post). This means that in theory you can not make a decisions like if it is an image on page do X as nothing ensures you that the image will not be … Read more
You can set the values with the filter wpcf7_form_tag and add the shortcode attributes with the filter shortcode_atts_wpcf7 add_filter(“wpcf7_form_tag”, function($scanned_tag, $replace){ if (“press_post” === $scanned_tag[“name”]) { $contact_form = WPCF7_ContactForm::get_current(); $number_of_posts = $contact_form->shortcode_attr(“number_of_posts”); $post_type = $contact_form->shortcode_attr(“post_type”); // using $number_of_posts and $post_type here $scanned_tag[‘raw_values’] = [ “number_of_posts \”$number_of_posts\” – post_type \”$post_type\” | val 1″, “Test 2|val 2”, … Read more
To answer the first part of your question, I have just put my class TTT_User_Profile_Addon on GitHub. The class offers a simple interface to add a field to a profile page. I have added an example for a checkbox subclass and some code to initialize it per functions.php. This works in a plugin too, of … Read more
In his answer , Jan Fabry made a brilliant solution, but it saves the values one by one (for each his own field ) for your question, we need to “reverse” that , but it is actually easy . BEFORE lines 409-413 , Jan Fabry made an if-else clause to seperate values into fields and … Read more
This isn’t a complete answer, but a couple of bits of advice – Don’t geocode the addresses on front-end requests, it’s a waste of cycles. An address only needs to be geocoded once, then you can store the lat/lon data with your post meta. Use a save_post hook to do the geocoding when the post … Read more
http://justintadlock.com/archives/2009/11/16/everything-you-need-to-know-about-wordpress-2-9s-post-image-feature LIsts a plugin: http://wordpress.org/extend/plugins/get-the-image I’m not sure by the article and description if what you are looking for is exactly what it does? It seems to imply that, but I’m not 100%