Support ForumClasses for element on just one page – Support Forum https://support.ishyoboy.com/forums/topic/classes-for-element-on-just-one-page/feed/ Wed, 08 May 2024 07:17:11 +0200 http://bbpress.org/?v=2.5.12-6148 en-US https://support.ishyoboy.com/forums/topic/classes-for-element-on-just-one-page/#post-1672 <![CDATA[Classes for element on just one page]]> https://support.ishyoboy.com/forums/topic/classes-for-element-on-just-one-page/#post-1672 Sat, 15 Feb 2014 10:45:18 +0000 Mugsus Hi IshYoBoy,

To create different columns on the pages of my website, I use the one_half elements on several pages. However, only on the homepage, I would like to add more padding to the columns. So I think I need to add a new class to the one_half elements in the homepage, so I can add CSS only for this page. However, is this possible using the [one_half] element, and how should I do this? I tried it by adding this in the editor [one_half class=”homepage”] and using the CSS:

But that didn’t do the trick. Is it even possible to add classes to the [one_half] elements? Or should I use the grid-elements to be able to add classes?

Thanks!

]]>
https://support.ishyoboy.com/forums/topic/classes-for-element-on-just-one-page/#post-1680 <![CDATA[Reply To: Classes for element on just one page]]> https://support.ishyoboy.com/forums/topic/classes-for-element-on-just-one-page/#post-1680 Mon, 17 Feb 2014 07:47:17 +0000 IshYoBoy Hey there,

The CSS you are trying to use is incorrect:

.homepage .grid6 – means apply the style to all “grid6” inside an element which has “homepage” class.

We think you are trying to do:

.homepage.grid6 – means apply the style to all “grid6” which also have “homepage” class.

So the code would be:

Cheers

A 5 star rating is always a great motivation for us if you are happy with our theme or support!
Themeforest | MojoMarketplace | Creative Market

]]>
https://support.ishyoboy.com/forums/topic/classes-for-element-on-just-one-page/#post-2075 <![CDATA[Reply To: Classes for element on just one page]]> https://support.ishyoboy.com/forums/topic/classes-for-element-on-just-one-page/#post-2075 Sat, 29 Mar 2014 13:14:01 +0000 Mugsus Hi IshYoBoy,

I’m still trying to change the style of certain elements, like the width of .grid6, on the homepage alone, and keep the style of .grid6 on all the other pages of the website as they were.

This might be a pretty stupid question, but how can I give a class to an element on just the homepage? Should I edit the homepage and add a class to the [one_half] elements, for example [one_half class=”homepage”]? I’ve tried this but it didn’t work.

I see the homepage has the following body class: <body.home.page.page-id-27.page-template-deafult.etc..>. I tried to use the selector [class*=”body.home.page-“].grid6{ but this doesn’t work either.

Eric

]]>
https://support.ishyoboy.com/forums/topic/classes-for-element-on-just-one-page/#post-2079 <![CDATA[Reply To: Classes for element on just one page]]> https://support.ishyoboy.com/forums/topic/classes-for-element-on-just-one-page/#post-2079 Mon, 31 Mar 2014 05:56:00 +0000 IshYoBoy Hi there,

1. How can I give a class to an element on just the homepage?
Exactly as you wrote. Go to the homepage, edit it and add a class to the shortcode you need. However use the “css_class” instead of “class” as WordPress TineMCE editor removes the “class” when you copy-paste your code within it. So:

[one_half css_class="my-classname"]

2. homepage has the following body class
The class you mentioned is not just one class, but many. So use just the right one of them. E.g:

<body class="home page page-id-27 page-template-default boxed bg1>

So the “home” class of the body element means it is a homepage.

try using the selector:

body.home grid6 { ... }

Maybe try having a look again on how CSS selectors work so you could be sure what you are doing.
Cheers

A 5 star rating is always a great motivation for us if you are happy with our theme or support!
Themeforest | MojoMarketplace | Creative Market

]]>
https://support.ishyoboy.com/forums/topic/classes-for-element-on-just-one-page/#post-2084 <![CDATA[Reply To: Classes for element on just one page]]> https://support.ishyoboy.com/forums/topic/classes-for-element-on-just-one-page/#post-2084 Mon, 31 Mar 2014 08:36:35 +0000 Mugsus Thanks, the selector you mentioned (body.home grid6) helps me out a lot! And it’s great to know I can add classes to the shortcodes, I’ll definitely start using that. You’re right about me having to read up on the CSS selectors, thanks again for helping me out though, amazing support!

]]>
https://support.ishyoboy.com/forums/topic/classes-for-element-on-just-one-page/#post-2087 <![CDATA[Reply To: Classes for element on just one page]]> https://support.ishyoboy.com/forums/topic/classes-for-element-on-just-one-page/#post-2087 Mon, 31 Mar 2014 09:06:15 +0000 IshYoBoy Sure thing! Very happy we could help out. Enjoy playing around with the theme!

A 5 star rating is always a great motivation for us if you are happy with our theme or support!
Themeforest | MojoMarketplace | Creative Market

]]>