I have used this plugin in one of my production site, surprisingly sometimes it’s pulling category thumbnail from another category when there is no thumbnail set. Please fix this.
]]>
]]>
How would I get the category thumbnail to be used as a background image? Primarily in category.php, but also in single.php
I am using this code to display the post thumbnail as a background image:
<?php $image_attributes = (is_singular() || in_the_loop()) ?
wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ),
‘full’ ) : null; ?>
<div class=”jumbotron jumbo-bkg” style=”<?php if($image_attributes)
echo ‘background-image:url(\”.$image_attributes[0].’\’)’ ?>”>
</div>
How can I in a single.php get the category thumbnail based on the current category the post is in?
]]>Hello,
could you fix function which generate img tag
function get_the_category_thumbnail
line 55
return sprintf('<img src="%s"%s />'...
to
return sprintf('<img src="%s" %s />'...
now alt is sticky to src attribute
Hi, I want to display category image in a template . I have used <?php echo the_category_thumbnail( $category_id ); ?>
but it is not working. Wait for your help. Thank you
Hi!
How can I get the width and height of category thumbnail?
]]>The code in this plugin doesn’t escape values before inserting them into SQL, so it breaks if you have plugins that add anything with single quotes to thumbnails something something. Anyway, near the bottom of category-thumbnails.php
replace this line:
$wpdb->query(sprintf('UPDATE <code>%sterm_taxonomy</code> SET
term_thu
with this:
if ($data !== NULL) {
$data = base64_decode($data);
}
$wpdb->update(
$wpdb->prefix . ‘term_taxonomy’,
array(‘term_thumbnail’ => $data),
array(‘term_id’ => $category)
);
`
And now maybe the plugin will start working, and you own’t accidentally bork your entire database.
]]>Hi !
I’m having some trouble with your plugin, he was working great since last week, now I can’t add other category thumbnail. It look like if the submit form won’t work or something similar,
have you any idea ?
]]>Hello
It can be possible to change de size of thumbnails in category thumbnail.
By default, the plugin will get the largest image size. I wanted to put the image in a size category defined by me. How do you do?
Thank you
]]>The plugin generated 235 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.
I installed the Category Thumbnails Plugin.
I went under categories in the admin panel.
Edit an already existing category. Clicked on “add Category image”.
After trying to upload an image, I got this database error:
Can someone help, please? ??
WordPress database error:
[You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's Guide to Heart Surgery",
"filesizeInBytes":95335,"filesizeHumanReadable":"93 kB' at line 1]
UPDATE <code>wp_term_taxonomy</code> SET <code>term_thumbnail</code>='{"id":37,"title":"landscape","filename":"landscape.jpg","url":"https://project.dev/app/uploads/2015/11/landscape.jpg","link":"https://project.dev/a-site/landscape/","alt":"","author":"1","description":"","caption":"","name":"landscape","status":"inherit","uploadedTo":26,"date":"2015-11-04T09:12:08.000Z","modified":"2015-11-04T09:12:08.000Z","menuOrder":0,"mime":"image/jpeg","type":"image","subtype":"jpeg","icon":"https://project.dev/wp/wp-includes/images/media/default.png","dateFormatted":"November 4, 2015","nonces":{"update":"148182415e","delete":"2bb9a7e647","edit":"627300347c"},"editLink":"https://project.dev/wp/wp-admin/post.php?post=37&action=edit","meta":false,"authorName":"WordPress User","uploadedToLink":"https://project.dev/wp/wp-admin/post.php?post=26&action=edit","uploadedToTitle":"A Patient's Guide to Heart Surgery","filesizeInBytes":95335,"filesizeHumanReadable":"93 kB","sizes":{"thumbnail":{"height":150,"width":150,"url":"https://project.dev/app/uploads/2015/11/landscape-150x150.jpg","orientation":"landscape"},"medium":{"height":168,"width":300,"url":"https://project.dev/app/uploads/2015/11/landscape-300x168.jpg","orientation":"landscape"},"full":{"url":"https://project.dev/app/uploads/2015/11/landscape.jpg","height":378,"width":674,"orientation":"landscape"}},"height":378,"width":674,"orientation":"landscape","compat":{"item":"","meta":""}}' WHERE <code>term_id</code>='1' LIMIT 1
Warning: Cannot modify header information - headers already sent by ...
As soon as I installed the Enable Media Replace plugin, I was not able to change or set any new category thumbnails. After deactivating Enable Media Replace, it works again. Hopefully this helps someone else!
]]>Hello,
Im try to use this code to do a List of categories, but i want to show only the thumbnail, but not work, can help?
<ul>
<?php
$args=array(
'orderby' => 'name',
'order' => 'ASC'
);
$categories=get_categories($args);
foreach($categories as $category) {
echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "Ver postagens em %s" ), $category->name ) . '" ' . '>';
if(has_category_thumbnail($category->term_id)) {
the_category_thumbnail($category->term_id)
}
echo '</a></li>';
}
?>
</ul>
]]>
Wonder if you can help on this one…
I have a Custom Post Type (‘sponsors’), and a Custom Taxonomy attached to that (‘sponsor-categories’).
The thumbnail uploader works fine with the Custom Taxonomy, and displays fine in the Admin UI list, but when I try to use echo get_the_category_thumbnail();
in my template (or other methods), it returns back as an empty <img>
tag.
A quick var_dump shows ["term_thumbnail"]=> NULL
even though the Admin UI shows otherwise.
Is it because I’m using a custom taxonomy? Do the API functions assume its going to be a ‘regular’ category?
Any light you can shed on this would be great ??
]]>A great plugin, congratulations!
I need to add a CSS class to “the_category_thumbnail()” function. I tried using array(‘class’ => ‘the-class’) but it doesn’t work. Can you help me. Thanks!
]]>Hi,
I have implemented all the things as described in the documentation,
Added support add_theme_support('category-thumbnails');
in functions.php and it created 1 column admin panel and thumbnail button is also visible and I can choose any picture for that.
But with some research I came to know that the data is not being saved in the database.
I checked this plugin with other theme created some custom taxonomies and there it is working fine.
Please guide me what could be the problem. Why the thumbnail data is not saved or updated.
Moreover I wrote the serialized data manually in the database, it was showing, but when I update, it is not updated the only thumbnail data. I is changing name and slug etc. of custom taxonomy
How i can get only the src or image, without the <img attribute and alt, only the URL.
]]>Hi there. It’s seems it’s not working with version 4.0. Is it possible?
I can easily add image to category, but then the thumbail is not displayed in the post.
thank you.
]]>How can I display category thumbnails on the single page (single.php)?
I try f.ex.:
]]><?php if(get_the_category($post->id)) { ?>
<? if (has_category_thumbnail($cat)) { the_category_thumbnail($cat); } } ?>
As title, the output HTML doesn’t have a space between the src and width attributes, leading to validation error. Nothing major but it’d be good if you can fix on the next release.
Cheers ??
]]>Great Plugin. Thank you for creating this! Is there away I can call a size argument?
For example: <?php the_post_thumbnail('custom-size'); ?>
I have several sizes already set up within my theme and would like to call one of those sizes.
Thanks in advance.
]]>hi!
I have used plugin for my website. I found a bug is thumb image has disappeared when Click Quick Edit. How to fix it.
Thankyou!
Tommy.
Hi! I want to change the thumbnail size, how can I do that?
if I use this : get_the_category_thumbnail(array(270, 170)); the plugin does not work, I was thinking it worked like “the_post_thumbnail()” function..
What kind of hack would have to do to make this work?
Thanks!
]]>Hello
I have use this plugin and also get the category image but I want to display thumbnail image instead of full image.
Can you please help me?
Thanks
Girish
I updated wordpress and the plugin has stopped working
]]>