• Resolved shengel1a

    (@shengel1a)


    Hello guys, you have awesome plugin. you can see i modified little it on my website, but i cant add post image ?? please can you help me to show post thumb?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Paul Jura

    (@pauljura)

    Hi, you are free to modify the plugin as you like, but I can’t support you with it.

    If you want to add a thumbnail to the marquee, I would suggest you edit the file pj-news-ticker.php, look for the the code where it renders the title and the link, and add your thumbnail there. Probably use the function get_the_post_thumbnail($post).

    Good luck.

    Thread Starter shengel1a

    (@shengel1a)

    Hey thanks for your fast response. I did not have much skills so i cannot do this ?? can you please help me?

    Plugin Author Paul Jura

    (@pauljura)

    Hi,

    Go to your website, look in the folder: wp-content/plugins/pj-news-ticker and edit the file pj-news-ticker.php

    At around line 170 you can add this code to include the post thumbnail:

    
    if (has_post_thumbnail($post)) {
    	$content .= '<img width="100" src="'.get_the_post_thumbnail_url($post).'">';
    }
    

    You can change width=’100″ to whatever size you like.

    The whole block should look something like this:

    
    $content .= '<span class="pjnt-item">';
    $content .= '<a target="'.$options['target'].'" href="'.get_permalink($post).'">'.get_the_title($post);
    if (has_post_thumbnail($post)) {
    	$content .= '<img width="100" src="'.get_the_post_thumbnail_url($post).'">';
    }
    if ($options['show_excerpt'] == 'true') {
    	$content .= ' - '.get_the_excerpt($post);
    }
    $content .= '</a>';
    $content .= '</span>';
    

    This is not something I want to include officially, as I don’t think it looks good. I think the marquee should be text only. But you are free to modify your own copy as you like. This should get you what you want.

    Good luck.

    Cheers,
    Paul

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘News Ticker Post Image’ is closed to new replies.