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; ?>
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

| improve this answer | |
  • Thank you so much. It worked. – Samuel Aug 23 '19 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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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