Custom Fields – Taller editing area

Large »Custom Field« Textareas. Gladly those are easy to target. Wrapped up in a small plugin: <?php ! defined( ‘ABSPATH’ ) AND exit; /* Plugin Name: (#65922) »kaiser« Bigger custom field textarea */ function wpse65922_big_customfield_textarea() { ?> <style type=”text/css”> #the-list textarea, #newmeta textarea { height: 200px; } </style> <?php } add_action( ‘admin_head-post.php’, ‘wpse65922_big_customfield_textarea’ ); add_action( … Read more

Getting the ID of any image for use in functions.php

Hopefully this helps, function mat_image_credit() { global $post; $args = array( ‘post_type’ => ‘attachment’, ‘post_parent’ => $post->ID, ‘post_mime_type’ => ‘image’, ‘numberposts’ => -1, ); $imgs = get_posts($args); foreach ($imgs as $img) { $field1 = slt_cf_field_value(‘flickr_credit’, ‘attachment’, $img->ID); $field2 = slt_cf_field_value(‘custom_credit’, ‘attachment’, $img->ID); if (!empty ( $field1 ) ) { echo ‘Image by ‘ . $field1; … Read more

Show 1 post and after a specific date show the next one

Assuming, as per the above comment, the format of the dates is YYYY/MM/DD: $args = array( ‘posts_per_page’ => 1, ‘cat’ => 6, ‘meta_key’ => ‘begin_date’, // adjust to actual key ‘meta_value’ => date( ‘Y/m/d’ ), ‘meta_compare’ => ‘>=’, ‘order’ => ‘ASC’, ‘orderby’ => ‘meta_value’ ); $wpse72195_query = new WP_Query( $args ); // do something with … Read more