• Resolved daniele89

    (@daniele89)


    Hi,
    is there a way to disable the icon representing the page/post type (e.g. a pencil for a standard post, a photo for a gallery post, etc.) shown beside the page/post title?

    I have already hidden the page title with the “disable title” plugin, but I would hide those icons too.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Answered in the FAQ. You don’t need a plugin to remove the titles: that’s in the FAQ too.

    Thread Starter daniele89

    (@daniele89)

    Sorry, I didn’t see that FAQ. Works perfectly for hiding the icon. Thanks!

    Before trying the plugin I had found that code for removing the title, but pasting it in the Customizr custom CSS section I didn’t see any change while using that plugin it worked. Maybe I did something wrong with the code? What is the difference between using that plugin and using the CSS? Excuse me if it’s a stupid question ??

    Yes, you probably had a typo in the CSS or something.

    The differences between using a plugin and using CSS are as follows:
    1. The plugin may contain other code/features as well as the one you want (that is, plugins can be very useful for doing a wide range of things).
    2. The plugin will be more likely (than a few lines of simple CSS) to cause you problems in the future with incompatibilities with other plugins or the theme itself (if they use the same function names, for example).
    3. The plugin, which will probably contain several function calls, will be slower to load than a few lines of simple CSS. So it will slow down your page–almost certainly by less than a second, but it all adds up when you have lots of plugins.
    4. Using CSS (especially with Firebug) will help you begin to understand how the theme works, so you will be able to tailor it to your needs in the future.

    Thread Starter daniele89

    (@daniele89)

    Thanks for the great explaination and your tips!

    I retried using the code

    .page .entry-title {
    	display: none;
    }

    Using it, the page titles are hidden. But the post titles still remain.

    I tried to use

    .post .entry-title {
    	display: none;
    }

    In this way the post titles are not shown. The only problem is that in that way the titles are also hidden in the Cathegory Archive, and there would be no way to get to the posts if you don’t know the direct link (cause the title contains the link to the post). Is there a way to hide the title only on the post page but not in the Cathegory Archive?

    So you want the page and post titles to be hidden, but the “Category Archives: <whatever>” to remain?

    Thread Starter daniele89

    (@daniele89)

    No, probably I din’t explain well what I mean. I understood how to remove page and post titles. And I don’t need to remove the Cathegoy Archives title. In fact, using the codes for pages and posts, that title (correctly) remains.

    My problem is: if I use

    .post .entry-title {
    	display: none;
    }

    the post title is hidden:
    – on the post page (correct, that’s what I want)
    – even in the Cathegory Archive. When I go to the Cathegory Archive, I only see the Archive title (if I don’t disable it) and the summaries of the posts. There is no post title, and consequently no link to the post and no way to go to the post for the site visitors.

    You would need to unhide it for the all the possible queries that might return a list of posts and/or pages. And that includes all type of archives (yearly, monthly, daily, hourly), authors list of posts or pages, search result, categories, taxonomies, custom post type lists, tag archives and I’m sure I’m missing some.
    You would need to add a selector for each of those body[class=””] selector s and, after you finish the list, add all of them {display: inline-block;}
    Something like…

    .archive .post .entry-title, .archive .page .entry-title,
    .search .post .entry-title, .search .page .entry-title,
    .category .post .entry-title, .category .page .entry-title,
    .taxonomy .post .entry-title, .taxonomy .page .entry-title,
    .author .post .entry-title, .author .page .entry-title
    /* you might continue this selectors list for quite a bit and than... */
    {display: inline-block;}

    Well, I guess I don’t have to tell you that in an environment as flexible as WP that’s more than counter-productive. Much more.
    Instead, the right approach is to find a more particular selector for the instances where you want to hide the titles. I understand you want to hide the titles only on single pages and on single posts. If that is correct, you need body.single-post and body.page selectors before your .entry-title. More than that, a good practice to add the id of a structural element of the page, usually a content container/wrapper in the selector. This gives the rule precedence over class-based selectors, no matter how precise they would be. #main-wrapper is perfect for that job. So the final solution would look like this:

    body.single-post #main-wrapper h1.entry-title,
    body.page #main-wrapper h1.entry-title {display: none;}

    The solution above will even allow you to display custom lists of posts or pages (search results, categories, etc) inside single pages or single posts, through the use of plugins or functions) as long as their output doesn’t make the .entry-title a h1 (usually the lists are either a’s or li’s…)

    Hope I haven’t been too technical.

    Thread Starter daniele89

    (@daniele89)

    Yes, that works!

    Thank you all for the help! ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to hide the icon beside the page/post title?’ is closed to new replies.