WordPress.org

Ready to get started?Download WordPress

Forums

TTFTitles- possible to add to a function call of title in a featured post list? (1 post)

  1. evelester
    Member
    Posted 4 years ago #

    I am not sure if it is possible, but I figured I would ask here before I gave up. I am wanting the title in the featured post carousel to be like the rest of the titles. (http://letterstobreathe.com)

    The only place the call to the title is mentioned is in the file called fn-general.php, I pasted the code that references the carousel below.

    I have tried adding the the_ttftext and the title one, and all I have managed to do is break the whole blog until I re-upload the original. The fn-general file also has other blog settings in it, it is held in the themes includes directory.

    function thman_carousel_featured_posts($max_posts=5, $offset=0) {
    	if(!function_exists('show_featured_posts'))
    		return false;
    
    	global $wpdb, $table_prefix;
    	$table_name = $table_prefix."features";
    
    	$sql = "SELECT * FROM $table_name ORDER BY date DESC LIMIT $offset, $max_posts";
    	$posts = $wpdb->get_results($sql);
    
    	$html = '';
    	$coint_i = 0;
    	foreach($posts as $post) {
    		$coint_i++;
    		$id = $post->id;
    		$posts_table = $table_prefix.'posts';
    		$sql_post = "SELECT * FROM $posts_table where id = $id";
    		$rs_post = $wpdb->get_results($sql_post);
    		$data = $rs_post[0];
    		$post_title = stripslashes($data->post_title);
    		$post_title = str_replace('"', '', $post_title);
    		$post_content = stripslashes($data->post_content);
    		$post_content = str_replace(']]>', ']]>', $post_content);
    		$post_content = strip_tags($post_content);
    		$permalink = get_permalink($data->ID);
    		$post_id = $data->ID;
    		$html .= '<div class="board_item">
    			<!-- board_item -->
    			<p>';
    
    		$thumbnail = get_post_meta($post_id, 'thumb_carousel', true);
    
    		if( isset($thumbnail) && !empty($thumbnail) ):
    			$html .= '<img src="'.$thumbnail.'" alt="'.$post_title.'" />';
    		endif;
    
    		$html .= '<a href="'.$permalink.'">'.thman_get_limited_string($post_title,50).'</a>'.thman_get_limited_string($post_content,160).'</p>
    			<p class="more"><a href="'.$permalink.'">Read more...</a></p>
    			<!-- /board_item -->
    		</div>';
    	}
    	echo $html;
    	return $coint_i;
    }

    thanks in advance for any help- even if it is just telling me it is not going to happen! I still have a lot of work left before I can go 'public' LOL

Topic Closed

This topic has been closed to new replies.

About this Topic