• Resolved deka.jayanta

    (@dekajayanta)


    Hi,
    I want the secondary title of my post to appear on the homepage (a static page). I can call the main default title through the code (.entry-title) but can’t get the secondary title. Is there any option?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter deka.jayanta

    (@dekajayanta)

    It isn’t just css. I want to call the secondary headline in my custom homepage. How to do it?
    Here in this page, http://www.easternfeed.com/, the top article is showing its main headline. I want the secondary headline to be here. I am using <?php echo $this->get_title();?> to get the main headline. Need a similar code for the secondary headline.

    Plugin Author thaikolja

    (@thaikolja)

    You can use <?php echo get_secondary_title($post_id, $prefix, $suffix, $use_settings); ?> for this. In most cases you don’t have to use the arguments ($post_id and so on) for this function, just in case you’d like to adjust it further.

    I hope that answers your question.

    Thread Starter deka.jayanta

    (@dekajayanta)

    Thanks for your reply.
    The settings is working great with the individual posts. But when I am trying to insert the code — as given by you — in the homepage, I am not getting any result. Am I missing something? I tried this as well: <?php echo get_secondary_title(); ?>. Still not done!

    Here’s the codes:

    <div class="<?php echo $this->get_module_classes();?>">
                <div class="meta-info-container">
                    <div class="td-module-meta-info">
                        <?php if (td_util::get_option('tds_category_module_18') == 'yes') ?>
                        <?php echo $this->get_title();?>
                        <?php echo get_secondary_title($post_id, $prefix, $suffix, $use_settings); ?>
                        <?php echo $this->get_author();?>
                        <?php echo $this->get_date();?>
                    </div>
                    <?php echo $this->get_image('td_696x385');?>
                                        
                </div>
    Plugin Author thaikolja

    (@thaikolja)

    Yes, if you have more than one post on the site, you need to use the $post_id argument.

    But I have no idea what $this is and what methods it has. Try $this->get_ID() or $this->ID() (don’t forget the echo) and if one of them returns the post ID number, use it for the secondary title parameter.

    Otherwise, I have to see the class $this is referring to.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Call Secondary Title Through CSS’ is closed to new replies.