0

How can i make wordpress blog event titles clickable and direct to their respective post itself? Thank you!

<li id="post-<?php the_ID(); ?>" <?php post_class( 'stm_post_info' ); ?>>
<?php if( get_the_title() ): ?>
    <h4 class="stripe_2"><?php the_title(); ?></h4>
<?php endif; ?>

2 Answers 2

0
<li id="post-<?php the_ID(); ?>" <?php post_class( 'stm_post_info' ); ?>>
<?php if( get_the_title() ): ?>
    <h4 class="stripe_2"><a href="<?php the_permalink() ?>" ><?php the_title(); ?></a></h4>
<?php endif; ?>

Please try this

1
  • Thank you so much. It worked.
    – Samuel
    Commented Aug 23, 2019 at 11:24
1

You can also try below one :

<li id="post-<?php the_ID(); ?>" <?php post_class( 'stm_post_info' ); ?>>
<?php if( get_the_title() ): ?>    <h4 class="stripe_2"><a href="<?php echo get_permalink($post->ID);?>" ><?php the_title(); ?></a></h4><?php endif; ?>

that is more specific with particular post

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.