Subtitle in slider

Posted in: Newsmag
Post count: 8

Hi, I would like to have subtitle shown in slider, above the post title. Can you provide the code to add to td_module_slide.php

Thanks,

Post count: 6535

Hi

You need to add this code in td_module_slide.php:

$buffy .= '<div class="td-excerpt">';
$buffy .= $this->get_excerpt(20);
$buffy .= '</div>';

Change the number from get_excerpts() function if you want more words in excerpts.
You will also need this css in theme panel > custom code > custom css to change text’s color: http://screencast.com/t/SaHG6RceCrU

.slide-meta  .td-excerpt{
color: white;
}

Thanks!

Post count: 8

Hi Andrei, thanks for your answer, but… I would like to display “subtitle” and not the “excerpt”.. is it possible?

Post count: 6535

HI

Sorry about that, it was my mistake. Yes you can add subtitles in slide by adding this code in td_module_slide.php: http://screencast.com/t/XDwRih0TUMKA

$subtitle = get_post_meta($this->post->ID, 'td_post_theme_settings', true);
if (!empty($subtitle['td_subtitle'])) {
$buffy .= '

' . $subtitle['td_subtitle'] . '

';
}

You also need to replace the above css with this one: http://screencast.com/t/WTOd0TLs

.slide-meta .td-post-sub-title{
color: white;
border: none;
margin: 0;
}

Let me know ho it goes.
Thanks!

Post count: 8

It works perfectly!! Thank you!

Post count: 27

Hello,

I would also like to include some text after the title from the content not from subtitle, or excerpt. I know how to strip html tags so it won’t include an image or anything funky, but when I try to put the following code:

$buffy .=  $this->get_title();//$this->get_title_main();
				$buffy .=  $this->get_content();

inside the td_module_slide.php I’m getting an error saying:

Fatal error: Call to undefined method td_module_slide::get_content() in /home/site/public_html/wp-content/themes/Newspaper-child/includes/modules/td_module_slide.php on line 47

Is there anything I’m missing? I mean, if some modules can support text from content, why td_module_slide can’t?

Post count: 27

Nevermind, I found it. Using get_excerpt() works as expected!

Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.