bstojkoski
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Popular Posts] First thumbnail padding bottom and excerptThis is the code I have in this moment:
/* * Customizes the HTML output of the WordPress Popular Posts widget. * * @param array $posts * @param array $options * @return string */ function my_custom_popular_posts_html_list( $posts, $options ){ $output = '<ul class="wpp-list wpp-list-with-thumbnails">'; $counter = 1; $first_thumbnail_size = array( 300, 200 ); // Change this $regular_thumbnail_size = array( 90, 70 ); // Change this // loop the array of popular posts objects foreach( $posts as $popular ) { // Thumbnail $thumbnail = ''; if ( $options['thumbnail']['active'] && has_post_thumbnail( $popular->id ) ) { if ( 1 == $counter ) { $thumbnail_src = get_the_post_thumbnail_url( $popular->id, $first_thumbnail_size ); } else { $thumbnail_src = get_the_post_thumbnail_url( $popular->id, $regular_thumbnail_size ); } $thumbnail = "<a href=\"" . get_permalink( $popular->id ) . "\"><img src=\"" . $thumbnail_src . "\" class=\"wpp-thumbnail wpp_cached_thumb wpp_featured\" alt=\"" . esc_attr( $popular->title ) . "\"></a>"; } $output .= "<li>"; $output .= $thumbnail; $output .= "<a href=\"" . get_permalink( $popular->id ) . "\" title=\"" . esc_attr( $popular->title ) . "\" class=\"wpp-post-title\">" . $popular->title . "</a>"; $output .= "</li>" . "\n"; $counter++; } $output .= '</ul>'; return $output; } add_filter( 'wpp_custom_html', 'my_custom_popular_posts_html_list', 10, 2 );I just need to update it?
- This reply was modified 8 years, 5 months ago by bstojkoski.
Forum: Plugins
In reply to: [WP Popular Posts] First thumbnail bigger than othersEverything is ok now.
Is it possible to have excerpt only on first post, and add padding from first thumbnail to title 5px?
Thanks a lot.
Forum: Plugins
In reply to: [WP Popular Posts] First thumbnail bigger than othersHello Hector.
I think now is ok with the small thumbnails, but the big one is with dimensions 375x250px.
Forum: Plugins
In reply to: [WP Popular Posts] First thumbnail bigger than othersI am using W3 Total Cache plugin.
I think that we should add css class in the code for the first thumbnail.
Forum: Plugins
In reply to: [WP Popular Posts] First thumbnail bigger than othersI made the upgrade, and nothing is changed.
I want to ask you if it’s possible the first post to have excerpt?
Forum: Plugins
In reply to: [WP Popular Posts] First thumbnail bigger than othersThe last one
Forum: Plugins
In reply to: [WP Popular Posts] First thumbnail bigger than othersI added the code, but nothing changed 🙁
Forum: Plugins
In reply to: [Related Posts by Sovrn] Post excerpt in modern styleSomeone for support?
Forum: Plugins
In reply to: [WP Popular Posts] First thumbnail bigger with post excerptHello Hector.
I updated the plugin to newest version on my website http://pletenje
I have problem with the small thumbnails. In functions.php I add 290, 200 on big one and 100, 70 for the smaller, but it crop them different.
Can you please help me?
Here is the code
function custom_popular( $mostpopular, $instance ){ $counter = 0; $output = '<ul class="wpp-list">'; foreach( $mostpopular as $popular ) { $permalink = get_permalink($popular->id); $excerpt = ""; // Different output for the first post: show different thumbnail and post excerpt (summary) if ( 0 == $counter ) { $thumbnail = "<a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">" . get_the_post_thumbnail( $popular->id, array(300, 200), array('alt' => esc_attr($popular->title), 'title' => esc_attr($popular->title), 'class' => 'wpp-thumbnail-first') ) . "</a>"; $excerpt = " <span class=\"wpp-excerpt\">" . get_excerpt_by_id( $popular->id ) . "</span>"; $output .= "<li>{$thumbnail} <a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\" style=\"font-size: 22px;\">{$popular->title}</a>{$excerpt}</li>"; } else { // Regular output $thumbnail = "<a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">" . get_the_post_thumbnail( $popular->id, array(100, 70), array('alt' => esc_attr($popular->title), 'title' => esc_attr($popular->title), 'class' => 'wpp-thumbnail') ) . "</a>"; $output .= "<li>{$thumbnail} <a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$popular->title}</a>{$excerpt}</li>"; } $counter++; } $output .= '</ul>'; return $output; } add_filter( 'wpp_custom_html', 'custom_popular', 10, 2 );Forum: Plugins
In reply to: [WP Popular Posts] First thumbnail bigger with post excerptHello Hector.
I updated the plugin to newest version on my website http://pletenje
I have problem with the small thumbnails. In functions.php I add 290, 200 on big one and 100, 70 for the smaller, but it crop them different.
Can you please help me?
Here is the code
function custom_popular( $mostpopular, $instance ){ $counter = 0; $output = '<ul class="wpp-list">'; foreach( $mostpopular as $popular ) { $permalink = get_permalink($popular->id); $excerpt = ""; // Different output for the first post: show different thumbnail and post excerpt (summary) if ( 0 == $counter ) { $thumbnail = "<a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">" . get_the_post_thumbnail( $popular->id, array(300, 200), array('alt' => esc_attr($popular->title), 'title' => esc_attr($popular->title), 'class' => 'wpp-thumbnail-first') ) . "</a>"; $excerpt = " <span class=\"wpp-excerpt\">" . get_excerpt_by_id( $popular->id ) . "</span>"; $output .= "<li>{$thumbnail} <a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\" style=\"font-size: 22px;\">{$popular->title}</a>{$excerpt}</li>"; } else { // Regular output $thumbnail = "<a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">" . get_the_post_thumbnail( $popular->id, array(100, 70), array('alt' => esc_attr($popular->title), 'title' => esc_attr($popular->title), 'class' => 'wpp-thumbnail') ) . "</a>"; $output .= "<li>{$thumbnail} <a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$popular->title}</a>{$excerpt}</li>"; } $counter++; } $output .= '</ul>'; return $output; } add_filter( 'wpp_custom_html', 'custom_popular', 10, 2 );Forum: Plugins
In reply to: [WP Popular Posts] First thumbnail bigger with post excerptHello Hector.
I update the plugin to newwest version on my website http://pletenje
I have problem with the small thumbnails. In functions.php I add 290, 200 on big one and 100, 70 for the smaller, but it crop them different.
Can you please help me?
Here is the code
function custom_popular( $mostpopular, $instance ){ $counter = 0; $output = '<ul class="wpp-list">'; foreach( $mostpopular as $popular ) { $permalink = get_permalink($popular->id); $excerpt = ""; // Different output for the first post: show different thumbnail and post excerpt (summary) if ( 0 == $counter ) { $thumbnail = "<a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">" . get_the_post_thumbnail( $popular->id, array(300, 200), array('alt' => esc_attr($popular->title), 'title' => esc_attr($popular->title), 'class' => 'wpp-thumbnail-first') ) . "</a>"; $excerpt = " <span class=\"wpp-excerpt\">" . get_excerpt_by_id( $popular->id ) . "</span>"; $output .= "<li>{$thumbnail} <a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\" style=\"font-size: 22px;\">{$popular->title}</a>{$excerpt}</li>"; } else { // Regular output $thumbnail = "<a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">" . get_the_post_thumbnail( $popular->id, array(100, 70), array('alt' => esc_attr($popular->title), 'title' => esc_attr($popular->title), 'class' => 'wpp-thumbnail') ) . "</a>"; $output .= "<li>{$thumbnail} <a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$popular->title}</a>{$excerpt}</li>"; } $counter++; } $output .= '</ul>'; return $output; } add_filter( 'wpp_custom_html', 'custom_popular', 10, 2 );Forum: Plugins
In reply to: [WP Popular Posts] First thumbnail bigger with post excerptHector, I am trying to add a permalink on the thumbnails, but I can find solution.
Can you help me please?
Forum: Plugins
In reply to: [WP Popular Posts] First thumbnail bigger with post excerptHector, you are awesome dude.
Plugin works great.
Thank you very much.
BrankoForum: Plugins
In reply to: [WP Popular Posts] First thumbnail bigger with post excerptWhen I remove this
$excerpt = " <span class=\"wpp-excerpt\">" . get_excerpt_by_id( $popular->id ) . "</span>"; } else { // Regular outputthe widget works. But there is no excerpt, and the thumbnails are 70×70.
And I want to ask you for help, how can I make the first post title font size bigger?
You can see the widget on http://pletenje.mk
Thanks a lot Hector.
Forum: Plugins
In reply to: [WP Popular Posts] First thumbnail bigger with post excerptI am watching the code now, and I see that there is no output for the first post.
function custom_popular( $mostpopular, $instance ){ $counter = 0; $output = '<ul class="wpp-list">'; foreach( $mostpopular as $popular ) { $permalink = get_permalink($popular->id); $excerpt = ""; // Different output for the first post: show different thumbnail and post excerpt (summary) if ( 0 == $counter ) { $thumbnail = get_the_post_thumbnail( $popular->id, array(300, 200), array('alt' => esc_attr($popular->title), 'title' => esc_attr($popular->title), 'class' => 'wpp-thumbnail') ); $excerpt = " <span class=\"wpp-excerpt\">" . get_excerpt_by_id( $popular->id ) . "</span>"; } else { // Regular output $thumbnail = get_the_post_thumbnail( $popular->id, array(90, 70), array('alt' => esc_attr($popular->title), 'title' => esc_attr($popular->title), 'class' => 'wpp-thumbnail') ); } $output .= "<li>{$thumbnail} <a href=\"{$permalink}\" title=\"" . esc_attr($popular->title) . "\">{$popular->title}</a>{$excerpt}</li>"; $counter++; } $output .= '</ul>'; return $output; } add_filter( 'wpp_custom_html', 'custom_popular', 10, 2 );