Changeset 1078238
- Timestamp:
- 01/29/2015 02:50:13 PM (11 years ago)
- Location:
- category-featured-images/trunk
- Files:
-
- 2 edited
-
category-featured-images.php (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
category-featured-images/trunk/category-featured-images.php
r1049144 r1078238 4 4 * Plugin URI: https://github.com/blocknotes/wordpress_category_featured_images 5 5 * Description: Allows to set featured images for categories, posts without a featured image will show the category's image (Posts \ Categories \ Edit category) 6 * Version: 1.1. 56 * Version: 1.1.8 7 7 * Author: Mattia Roccoberton 8 8 * Author URI: http://blocknot.es … … 90 90 } 91 91 else $size = 'thumbnail'; 92 if( is_single() ) 92 if( isset( $args['cat_id'] ) ) 93 { 94 $cat_id = intval( $args['cat_id'] ); 95 $images = get_option( 'cfi_featured_images' ); 96 if( isset( $images[$cat_id] ) ) 97 { 98 $img = wp_get_attachment_image( $images[$cat_id], $size ); 99 if( !empty( $img ) ) return '<span class="cfi-featured-image">' . wp_get_attachment_image( $images[$cat_id], $size ) . '</span>'; 100 } 101 } 102 else if( is_single() ) 93 103 { 94 104 $image = get_the_post_thumbnail( null, $size, $args ); -
category-featured-images/trunk/readme.txt
r1049144 r1078238 24 24 * 'alt': alternative text of the image tag 25 25 * 'title': title of the image tag 26 * 'cat_id': select a specific category id 26 27 27 28 Shortcode example: … … 36 37 37 38 cfi_featured_image_url( array( 'size' => 'large' ) ); 38 39 cfi_featured_image_url extra argument:40 41 * 'cat_id': get the image URL of a specific category id42 39 43 40 Notes: … … 58 55 == Upgrade Notice == 59 56 57 = 1.1.8 = 58 * Added 'cat_id' param to cfi_featured_image 60 59 = 1.1.5 = 61 60 * Loads parent category image if nothing is found before … … 70 69 == Changelog == 71 70 71 = 1.1.8 = 72 * Added 'cat_id' param to cfi_featured_image 72 73 = 1.1.5 = 73 74 * Loads parent category image if nothing is found before
Note: See TracChangeset
for help on using the changeset viewer.