Home / Forums / DynamiX Support / How to display article subtitle in shortcode [recent_posts]

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts

  • Cornelius M
    Participant

    Hi there!

    first of all, thank you this amazing looking theme!

    I am wondering if there is a posssibility to display an article's subtitle ('Post Sub Title' /postsubtitle) along with the main title when using the shortcode [recent_posts]. This is the shortcode I am using in my page:


    [recent_posts content="textimage" categories="News" image_effect="" undefined image_width="100" image_height="73" image_align="alignleft" order="date" orderby="ASC" excerpt="65" limit="10" /]

    This gives me the article's image, the article's main headline and an excerpt of the article. I would like to also have the article's sub title included as well.

    In single post view, the subtitle is displayed, as included in single.php:


    $pdata = maybe_unserialize(get_post_meta( $post->ID, 'pgopts', true ));
    [...]
    $DYN_postsubtitle=$pdata["postsubtitle"];
    [...]
                                <?php if($DYN_postsubtitle) { ?>
                                <h2><?php echo htmlspecialchars($DYN_postsubtitle); ?></h2>
                                <?php } ?>

    In the PHP-code for the shortcode [recent_posts] (shortcodes.php), however, the subtitle is not mentioned at all:


    <div>
    <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
    (Reference to subtitle should be included here, I guess)
    <?php if($content!='titleimage') { ?>
    <?php the_excerpt_reloaded($recent_excerpt, '<a>', 'content', false); ?>
    <a class="read-more" href="<?php the_permalink(); ?>"><?php _e( 'Read More', 'DynamiX' ); ?></a>
    <?php } ?>
    </div>

    Therefore I was wondering if there is a way to manually include the subtitle in this shortcode?

    Thank you very much!

    Cornelius

    Andy
    Andy
    Keymaster

    <?php $pdata = maybe_unserialize(get_post_meta( $post->ID, 'pgopts', true ));

    $DYN_postsubtitle=$pdata["postsubtitle"]; ?>

    <div>
    <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
    <h5><?php echo $DYN_postsubtitle; ?></h5>
    <?php if($content!='titleimage') { ?>
    <?php the_excerpt_reloaded($recent_excerpt, '<a>', 'content', false); ?>
    <a class="read-more" href="<?php the_permalink(); ?>"><?php _e( 'Read More', 'DynamiX' ); ?></a>
    <?php } ?>
    </div>
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.