css support in premium sites
-
-
I have not bought a premium package here yet, and I’m trying to figure out if I can do something that would be done on a free-standing WordPress site.
The function I believe I’m looking for is:
is_category(
From what I’ve been able to gather here in browsing around the forum, is that it looks like some themes support this kind of function coding, and some do not.
What I would like to do is have background images change corresponding to the category of the post that contains the images. (I’m also looking for a parallax effect, but that’s just CSS coding.)
Any help would be appreciated.
-
Hi @danielbrenton, it does depend on your theme, but you would typically use the CSS class, like .category-animals { }
using category-[slug] for the category.
I want to say the category archive pages will have that in the body class, but individual posts might not. I’d need to check on that. The would have it in the entry’s class though, at least.
Is that site hosted here? You mentioned a free-standing WordPress site? These forums are actually for the sites hosted here at WordPress.com, but there’s a developer forum at https://wordpress.org/support/forums/ .
-
One more tip too: when you start a thread, you’ll want to avoid replying to yourself. Volunteers often look for threads with no replies, so yours could be missed if it has a response (yours.)
-
@supernovia, thank you for the response.
Yes, I fumbled my original post. There was quite a bit more I should have asked, so I simply replied to it. (This is my first post here.)
Also, I did note in my reply:
I have not bought a premium package here yet, and I’m trying to figure out if I can do something that would be done on a free-standing WordPress site.
Perhaps I should have said “could,” not “would.”
My intent is to host my site here, but I am finding it very difficult to see how effective this would be before I actually sign up for a pay plan. Until I do sign up, I don’t have access to custom CSS and so on.
I did fish around in some of the themes earlier today, and frankly was frustrated in that there was very little I could do to verify if a theme would actually work for me, because I don’t have access to all of the features of theme until I upgrade.
There are advantages using WordPress (dot) com, and disadvantages.
I am not really all that strong with function or CSS editing, but it seems implied by your answer that if I edit the CSS for, say, the header background image to call for the image defined for the category, and add CSS classes that define what image each class uses, I’d be heading in the right direction. That, in fact, I wouldn’t need to edit any function at all.
Am I following you?
-
Am I following you?
Kinda. CSS and the header functions can be separate.
WordPress.com and WordPress.org can be quite different unless you’ve got the Business or eCommerce plans, which would allow you to upload plugins and custom child themes. Otherwise you’d be using the Premium plan and CSS.
But, you can often use your browser to test whether something’s possible with CSS, like so:
https://wordpress.com/support/custom-design/how-to-find-your-themes-css/And, if you start with a free site here, or import your content into a free site here, we could check, too. Please be advised though, the more advanced CSS like this is out of the scope of support of what staff can offer, too, so you’d likely either need to understand how to do it or hire someone to help.
For what it’s worth, though, I did some digging last night and found that the category page (list of posts within a category) will have a class in the body of that page, however most themes don’t automatically specify a category in the body of a single post. That ends up in the entry instead of in the body.
That probably sounds like greek if you don’t know CSS, but, essentially on a single post it’s a bit harder to change the background for the body of the entire page. You could still change the background of the post section itself, though.
-
Fair enough.
It’s been a while since I’ve wrestled with CSS and functions, but I was fairly successful in working through those things (with time) in the free-standing WordPress. Thank you for the suggestion of editing CSS in a browser view. I used to check CSS and values in Firebug (remember that?) but never tried to edit in it.
And thank you for looking into the use of category class in themes. I appreciate it.
- The topic ‘css support in premium sites’ is closed to new replies.