简体   繁体   中英

Wordpress: How do I fix my post class?

I seem to have somehow messed up when wordpress calls the post class. I looked in "Main Index Template" but that just says " <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> " So I don't know what to do.

Do you mean the id's and class name not printing out on the front end?

Add an echo like the example below so that the id and class is printed out.

<div <?php echo post_class() ?> id="post-<?php echo the_ID(); ?>">

You need to give more information but If something has gone wrong because of you editing the files then I would suggest you to replace the file from www.wordpress.org.

If it is s theme file then replace the theme.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM