wordpress built-in Jalali date convertor
wordpress built-in Jalali date convertor
wordpress built-in Jalali date convertor
I agree with Denis, I don’t like using custom fields for this kind of stuff, but I’m not aware of any other way yet… What you what can be done by altering the SQL query for the loop, something like this: add_filter(‘posts_join’, ‘my_post_filter_join’); function my_post_filter_join($join) { global $wpdb; if(is_home() || is_category() || is_search()) $join .= … Read more
If you’re trying to navigate between posts in the same category, would next_post_link()/previous_post_link() work for you? These functions have an $in_same_cat argument, that would appear to suit your needs? EDIT: Here is a Plugin, WP Category Archives, that might point you in the right direction? It purports to display: …a monthly or yearly archive of … Read more
I have a fancy function that i made just for that: <?php /* Create taxomony term list of posts based on given year * * @param $year – (int) 4 digits – the year to return the list of. required * * @param $taxonomy – (string) the taxonomy name of which the retreve the terms. … Read more
WordPress doesn’t have “tweeting” functionality built in. However, post scheduling is built in. You just set the time when you want the post to publish on the edit post screen. If you use a twitter plugin like my own Simple Twitter Connect, and you schedule a post, then it will send the tweet at the … Read more
Rajeev Vyas is more or less correct… personally I think the best way to do this is to make a tiny plugin that will update all your dates when the plugin is activated. After updating the dates… delete the plugin and keep in mind that if you activate the plugin again all your dates will … Read more
You shouldn’t need to use a meta field for this logic. In the loop $post->post_date holds when the post is published. From there you can determine if the date is 90 days old: $datetime = strtotime($post->post_date); if( $datetime < ( time() – ( 60 * 60 * 24 * 90 ) ) ) { echo … Read more
I recently did exactly the same, you’ll have to use custom query: $date = time()-86400; /* today */ $querystr = ” SELECT $wpdb->posts.* FROM $wpdb->posts, $wpdb->postmeta WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->posts.post_status=”publish” AND $wpdb->postmeta.meta_key = ‘event_date’ AND $wpdb->postmeta.meta_value > ” . $date . ” ORDER BY $wpdb->postmeta.meta_value ASC “; $pageposts = $wpdb->get_results($querystr, OBJECT); foreach ($pageposts … Read more
Iterate over all posts, find the attached images … $images =& get_children( array ( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’ ); … and for each image use wp_update_post() to set the date from the parent post.
Time is one of the things in environment WordPress normalizes to GMT, so all native PHP function give that in WordPress context. To get time in timezone, set in WordPress settings, try date_i18n() instead.