• How to add styles when there is NO CSS class or ID? I want to hide the selected theme from tis wordpress themes page. As you can see there is NO unique ID or class I can use for that particular thmb. How to find a selector in this case so that I can use {“display:none”: Which CSS selector I can use? OR any other php? alternative? please see image.

    View post on imgur.com

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • I’m confused as to what you want to do. Let me see if this is correct. You want to keep a theme from display under the themes tab of your desktop.

    The image you show is a display is of all themes you curretly have installed. If you don’t want it to display you can simply remove from your themes.

    It probably safer to remove unused themes from your site. It gives hackers fewer openings to exploit. IF you remove it from your directory you can add it back at a later date. WordPress will remember all your settings.

    You might be able to use jQuery to target that element using the ‘data-slug’ value. That’s really the only thing that I can see that might work.

    But the bigger question is… why do you want to do this? I can’t think of a good reason for this myself.

    Thread Starter phyle5

    (@phyle5)

    Thanks @catacaustic
    Yes I want to keep the theme, but HIDE there in the wordpress’s themes page.

    Sadly I am not a jquery expert, is there any way we can use CSS to “Hide” it?

    But why do you want to hide it? :/ It doesn’t make any sense to hide anything on that page, especailly when you’re using a child theme, and that theme needs to be there anyway so anyone that looks at the page will now that something is strange/wrong.

    You can use CSS if you can be sure of that theme always being in that position in the list.

    .themes div:nth-child(2) {
        display: none;
    }

    That’s a guess at it, but that sort of thing.

    But again, I see no reason why anyone would want to do this.

    Thread Starter phyle5

    (@phyle5)

    I have a contract with a client who want full access but also want to give 1 year free technical maintenance. I do not want them to mess with main theme, upgrade, or anything, I have hidden few core items. Once I handover after 1 year period I can just simply remove the CSS.

    nth-child may work temporarily , but the moment they delete or download a new theme (Which I am sure these enthusiast client will do) it will stop working ( will applied to another theme)

    My core question is, in such cased where we dont have ID or classes, what are our options?

    My core question is, in such cased where we dont have ID or classes, what are our options?

    Numbering, as I showed. Tha’s it. There’s no other options.

    What wou;d work better is to give them some training on things that they can do,a nd things that they shouldn’t do, and make sure that you have financial pentalies for the bad things. Things like they have to pay extra support if they change themes, install/remove plugins, etc. That way they will be able to see everything but they’ll know that if they break something there’s consequences.

    Thread Starter phyle5

    (@phyle5)

    @catacaustic you are right! Many thanks for your help, and advise!!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Which CSS selector I can use? any other js/css/php? alternative?’ is closed to new replies.