set_post_thumbnail_size(80, 80, false);
but i want to use max measures not fixed ones..
is there any way to include CSS inside that php tag ?
i already have this in my css file :
.post-thumbnail, .attachment-post-thumbnail {
max-height: 300px;
max-width: 540px;
}
but since it is a post thumbnail they add html height="" width=""
any help is kindly appreciated !
^ sam
All of a sudden my WP installation has trouble uploading featured images.
When I’m composing a Post and click on ‘Set Featured Image’, the Create Featured Image popup window falsely shows an empty Media Library. There should be images there. Also on the Upload Files tab, uploading a new image ends with an error, but the image does appear in the Media Library when I directly open the Media Library from the WP menu.
Screenshot 1: https://i59.tinypic.com/2qipxlj.png
Screenshot 2: https://i60.tinypic.com/315zaev.png
Everything worked fine before. All I did today was allowing a plugin to update and install a plugin to try out. The plugin was Multiple Featured Images. (https://www.ads-software.com/plugins/multiple-featured-images/)
After trying the plugin I disabled it and deleted it.
Immediately after I tried disabling ALL plugins to see if any plugins are related to the problem but there is no difference. I’ve also disabled all browser plugins on my computer (such as Ad Blockers and Pop Up Blockers).
I’ve also tried loading the site on different computers and browsers.
The problem remained.
So I re-installed all WP files through the Dashboard > Updates screen.
The problem STILL remains.
Because of this I’m assuming the problem must be server-side. Maybe some cashing gone bad? But I have no idea how to fix this.
My questions:
– Is my assumption right, or are there other possible causes?
– In case of a server side cashing problem, what can one do?
Thank you
https://www.ads-software.com/plugins/latest-posts-by-author-with-content/
]]>if (function_exists('add_theme_support')) {
add_theme_support('post-thumbnails');
}
set_post_thumbnail_size( 50, 50 );
just as an attempt to see if anything works. Yet all the times I use
<?php the_post_thumbnail(); ?>
I just shows the full size image but shrunk down to size due to my css.
I’ve tried using the regenerate thumbnails plugin every time i made a change but I still cant work it out.
Thanks for any help and I can provide any additional information you may need.
]]><meta property="og:image" content="<?php $image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,'large');
$image_url = $image_url[0]; ?>"/>
I’ve also used the same the post thumb declaration as on the homepage to no avail. I was hoping someone had some insight as to why WordPress isn’t recognizing my post thumbs on a single post page.
Main: https://blog.fethastyx.com/
Single Post: https://blog.fethastyx.com/2011/04/redfish-fishing-report-with-chris-williams-lafitte-la/
I really appreciate any help!
Thanks in advance,
Nick
https://i26.tinypic.com/2ivgobm.png
Everytime you write a post with a video from YouTube or where ever in Post-Thumb Revisited? Because I include images with all my posts, even if there’s videos and I’d like it if it showed the actual image I posted rather than that dumb media stream.
Thanks.
]]>/***********************************************************************************/
/* get_posts hack
/***********************************************************************************/
function pt_get_posts($args) {
global $wpdb;
$defaults = array(
'showposts' => 5, 'offset' => 0,
'cat' => '', 'orderby' => 'post_date',
'order' => 'DESC', 'include' => '',
'exclude' => '', 'meta_key' => '',
'meta_value' =>'', 'post_type' => 'post',
'post_status' => 'publish', 'post_parent' => 0
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
$showposts = (int) $showposts;
$ecat = explode(',', $cat);
$ducky = (int) $ecat[0];
if ($ducky < 0) $exclcat = 'NOT '; else $exclcat = '';
$cat = implode(',',$ecat);
$offset = (int) $offset;
$post_parent = (int) $post_parent;
$inclusions = '';
if ( !empty($include) ) {
$offset = 0; //ignore offset, category, exclude, meta_key, and meta_value, post_parent if using include
$cat = 0;
$exclude = '';
$meta_key = '';
$meta_value = '';
$post_parent = 0;
$incposts = preg_split('/[\s,]+/',$include);
$showposts = count($incposts); // only the number of posts included
if ( count($incposts) ) {
foreach ( $incposts as $incpost ) {
if (empty($inclusions))
$inclusions = ' AND ( ID = ' . intval($incpost) . ' ';
else
$inclusions .= ' OR ID = ' . intval($incpost) . ' ';
}
}
}
if (!empty($inclusions))
$inclusions .= ')';
$exclusions = '';
if ( !empty($exclude) ) {
$exposts = preg_split('/[\s,]+/',$exclude);
if ( count($exposts) ) {
foreach ( $exposts as $expost ) {
if (empty($exclusions))
$exclusions = ' AND ( ID <> ' . intval($expost) . ' ';
else
$exclusions .= ' AND ID <> ' . intval($expost) . ' ';
}
}
}
if (!empty($exclusions))
$exclusions .= ')';
$query = "SELECT DISTINCT * FROM $wpdb->posts ";
$query .= empty( $cat ) ? '' : ", $wpdb->term_relationships, $wpdb->term_taxonomy ";
$query .= empty( $meta_key ) ? '' : ", $wpdb->postmeta ";
$query .= " WHERE 1=1 ";
$query .= empty( $post_type ) ? '' : "AND post_type = '$post_type' ";
$query .= empty( $post_status ) ? '' : "AND post_status = '$post_status' ";
$query .= "$exclusions $inclusions " ;
$query .= empty( $cat ) ? '' : "AND ($wpdb->posts.ID = $wpdb->term_relationships.object_id AND $wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id AND $wpdb->term_taxonomy.term_id ".$exclcat."IN (" . $cat. ") AND $wpdb->term_taxonomy.taxonomy = 'category') ";
$query .= empty( $post_parent ) ? '' : "AND $wpdb->posts.post_parent = '$post_parent' ";
$query .= !empty( $meta_key ) && !empty($meta_value) ? " AND ($wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = '$meta_key' AND $wpdb->postmeta.meta_value = '$meta_value' )" : '';
$query .= !empty( $meta_key ) && empty($meta_value) ? " AND ($wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key LIKE '$meta_key%' )" : '';
$query .= " GROUP BY $wpdb->posts.ID ORDER BY " . $orderby . ' ' . $order;
if ( 0 < $showposts )
$query .= " LIMIT " . $offset . ',' . $showposts;
$posts = $wpdb->get_results($query);
update_post_caches($posts);
return $posts;
}
]]>