How d0 i get the number of attachments in the post

Use following code to do the work : global $post; $page_id = $post->ID; $all_attachments = get_posts( array( ‘post_type’ => ‘attachment’,’post_mime_type’ => ‘image’, ‘post_parent’ => $page_id, ‘post_status’=>’published’, ‘numberposts’ => -1 ) ); $no_of_photos = count($all_attachments); // Gets the number of photo’s attached in $no_of_photos variable $first_img_URL = get_permalink($all_attachments[0]->ID); // Gets the URL of first attachment in … Read more

How to change a specific admin label

You could try that with the gettext filter in the following manner. function rename_header_to_logo( $translated, $original, $domain ) { $strings = array( ‘Header’ => ‘Logo’, ‘Custom Header’ => ‘Custom Logo’, ‘You can upload a custom header image to be shown at the top of your site instead of the default one. On the next screen … Read more