• Resolved cavey85

    (@cavey85)


    Hi,

    I want to remove from the HTML code of posts or pages:
    class author-; post_tag-, even/odd, category-;
    and id = “post-ID”!

    Can somebody help me with this, you may have a php code that you insert into the functions.php eliminate these things?

    Thx,
    cavey85

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    That really all depends on the theme you are using. Not all themes are coded in the same manner. Are you able to post a link to demonstrate what you mean?

    Thread Starter cavey85

    (@cavey85)

    e.g.
    <div id=”post-4564″ class=”post post-4564 category-48 category-dancing logged-in”>
    [ https://codex.www.ads-software.com/Function_Reference/post_class ]

    <div id=”post-586″ class=”hentry post post-1 odd author-admin category-css category-css3 category-general-web-development clearfix”>

    c85

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    As I mentioned, it all depends on how the theme is coded. Not all themes use the same markup. Please keep in mind that if you are going to be making any changes, you will want to use a child theme so you don’t lose any change when the theme is updated.

    You might also like to consider asking your question with the them developer. If it’s a WordPress repository theme, there’s a dedicated theme forum and if it’s a commercial product you should expect support from the theme dev.

    you can either go through all your theme’s template files, and remove the ‘post_class()’ and ‘post-ID’ codes there (ideally via a child theme) or add a filter function into functions.php of your (child) theme, to remove the post_class() output – see the link to the Codex chapter you have posted yourself..

    unfortunately, this will generally not remove the post-ID output which is most likely coded into the templates.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove post_tag-; author-; odd/even etc from HTML code’ is closed to new replies.