WordPress.org

Ready to get started?Download WordPress

Forums

Carousel Horizontal Posts Content Slider
[resolved] I want the image to link to post (8 posts)

  1. mariaMpo
    Member
    Posted 1 year ago #

    Hi thank you for a great plugin!

    I have question. How can i link the image to the post. I have managed to link the title but I need to do so with image as well. Any ideas?

    Thank you!

    http://wordpress.org/extend/plugins/carousel-horizontal-posts-content-slider/

  2. astpaul
    Member
    Posted 1 year ago #

    Yes, you have to modify line 45 of carousel-horizontal-posts-content-slider.php

    with

    $slider_gallery.= 'post_title . '">'.attachment_image_filter($post->ID, 'thumbnail', 'title="' . $post->post_title . '"').'';

  3. birdrockdesigns
    Member
    Posted 1 year ago #

    Hi, I'm really liking this plug in. I need to image to link as well, however when I put the PHP code in, I get a Server 500 error. Is there a syntax issue perhaps? Thanks for your great work.

    Here's part of the code `$slider_gallery.= '<div id="foo_content">';

    if($displayimage=="YES"){

    $slider_gallery.= attachment_image_filter($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"');
    //$slider_gallery.= 'post_title . '">'.attachment_image_filter($post->ID, 'thumbnail', 'title="' . $post->post_title . '"').'';`

  4. subhansanjaya
    Member
    Plugin Author

    Posted 1 year ago #

    (Line #35-53 )
    Please, use this code -

    foreach( $myposts as $post ){
    
    		$post_title = $post->post_title;
    		$post_link =  get_permalink($post->ID);
    		$post_content = $post->post_content;
    		$displaydesc= $word_imit;
    
    		$slider_gallery.= '<div id="foo_content">';
    
    		if($displayimage=="YES"){
    			$slider_gallery.= '<a href="'.$post_link.'">'.attachment_image_filter($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"').'</a>';
    		}
    		//$slider_gallery.= '<br/><h2>'.$post_title.'</h2><br/>';
    		//$slider_gallery.= '<p><span class="foo_con">'.tchpcs_clean($post_content, $displaydesc).'</span></p>...';
    
    		//$slider_gallery.= '<br/><span class="more"><a href="'.$post_link.'">read more</a></span>';
    		$slider_gallery.= '</div>';
    
    	}

    Thank you

  5. birdrockdesigns
    Member
    Posted 1 year ago #

    Works perfectly, thank you very much!

  6. manindra.rana
    Member
    Posted 1 year ago #

    i m new to wordpress i want to use this plugin on my site but unable to know that how can we add images to slider??

  7. subhansanjaya
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    You need to set featured image for each post in order to display images. Please, have a look at the following URL.

    http://codex.wordpress.org/Post_Thumbnails

    Thank you.

  8. subhansanjaya
    Member
    Plugin Author

    Posted 1 year ago #

    resolved

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.