How can i make wordpress blog title clickable and direct to the post itself

How can i make wordpress blog event titles clickable and direct to their respective post itself? Thank you!<li id=&qu

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

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; ?>
Share Improve this question edited Aug 23, 2019 at 12:32 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Aug 23, 2019 at 11:06 SamuelSamuel 31 bronze badge
Add a comment  | 

2 Answers 2

Reset to default 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

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745221668a4617277.html

相关推荐

  • How can i make wordpress blog title clickable and direct to the post itself

    How can i make wordpress blog event titles clickable and direct to their respective post itself? Thank you!<li id=&qu

    9小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信