|
How do you do CSS in WordPress?
09-18-2007, 04:47 PM
|
How do you do CSS in WordPress?
|
Posts: 5,662
Name: John Alexander
|
I know its possible to go into HTML and add class="something" but is there any kind of widget or something that makes it easier? Like when I'm typing this question out here on webmaster-talk.com, there's a drop down for what font I want, and another for what color. Is there any kind of widget or plugin or whatever you call them for WordPress to give me an item in my toolbar to select all the different classes available in CSS?
I use a h2 and h3 tag every now and then when I make a long post and want to break it up into sections. This is enough of a pain, just to wrap <h2>and</h2> tags around the code. But I don't use CSS to emphasize certain concepts, and the more I learn here, the more it seems like CSS would help my blog readers to make sense of the info I present. Which in turn helps me get more readers and occasional glances.
I'm not sure exactly how I'd do it, but one thing I'm considering is to have different CSS classes for linking to an external site, an old post of mine, a category, a Google search. They could each have a little icon after them so users know what kind of link it is without having to hold the mouse over it. And then I just get the sense that once I get started, I'll find all kinds of other ways to make it more useful.
|
|
|
|
09-18-2007, 09:22 PM
|
Re: How do you do CSS in WordPress?
|
Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
|
I don't think there's something quite like that. I assume you know your css file is in your theme's folder.
wp-content/themes/your-theme
Look there first to see what classes, etc exist.
There is a plugin that lets you attach css to specific posts. If I could remember the name I would tell you. Check the WordPress Codex (the WordPress manual), specifically this page about plugins. You can find resources to lots of plugins.
I've also found quite a few just by using Google.
I've never seen one along the lines of what you want, but for me it's simply easier to go into the css file directly and rewrite what's there and create new styles.
|
|
|
|
09-19-2007, 01:11 PM
|
Re: How do you do CSS in WordPress?
|
Posts: 5,662
Name: John Alexander
|
It's not creating the styles, I can do that in Web Expression, but what's the easiest way to apply them to the material you write? Here you can select some text and then click the color picker, a different font, whatever. Most editors that understand CSS let you pick the style for whatever text you select from some kind of menu?
|
|
|
|
09-19-2007, 08:07 PM
|
Re: How do you do CSS in WordPress?
|
Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
|
Oh. I think I misunderstood. If there's a class set you want to use add class="className" when you write the post.
Typically you don't need to add html code to your posts, but you can. Just make sure you're in the code view when editing the post.
WP will automatically add <p> tags even if you don't, but if you want to style a paragraph just add the <p class="className"></p> around your paragraph.
Is that what you meant.
|
|
|
|
09-20-2007, 06:22 PM
|
Re: How do you do CSS in WordPress?
|
Posts: 5,662
Name: John Alexander
|
Sort of - but is there a way in the editor to do this, so you don't have to mess with the code itself?
|
|
|
|
09-20-2007, 09:07 PM
|
Re: How do you do CSS in WordPress?
|
Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
|
I don't think so, but I really don't know since I never use the WYSIWYG editor. It's easier for me to type the code.
I think there are some plugins that improve the functionality of the WSYIWYG, but I doubt there's going to be anything where you pick classes from a list of something like that.
I think most people using the editor would just make something bold or bigger or purple or whatever and not try to set things up as a class. I'm not sure someone would have created a plugin for that, but it's worth searching for one and it's probably worth it for someone to develop one.
|
|
|
|
09-20-2007, 10:52 PM
|
Re: How do you do CSS in WordPress?
|
Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
|
I've always just used code view. You can do a lot declaratively; you might set something like #content p { text-align: justify; } in your CSS and not have to assign a class manually to every paragraph. Personally, I find working with images, links, code - that's a nightmare in wordpress by the way - and ul or ol and li tags to be much easier in code view, than trying to figure out which button is going to do what I want. The indent button does different things in different situations; if I want a block quote, I'll use that, otherwise I'll use something else.
Anyway, I haven't plugged anything into wp other than the spam filter, so I can't help you there. But you might want to try your hand at the code editor directly ... it's a time saver in the long run.
|
|
|
|
09-21-2007, 01:28 AM
|
Re: How do you do CSS in WordPress?
|
Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
|
What Steven and Forrest said. Any time I want to apply a class to something (e.g. the images that I float to the right on my posts), I just type it out in code form.
For some code snippets (e.g. anything Youtube-related, since WP messes up the code), I have a generic sample stored on my HD and then just replace the important values once I copy and paste it. It's not especially elegant, but it works.
|
|
|
|
09-21-2007, 02:56 AM
|
Re: How do you do CSS in WordPress?
|
Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
|
Forrest you might want to search some of the plugins. I think there are a few to make adding code easier to a post. There are some very good plugins available for all sorts of things.
Adam I've used that same inelegant solution.
|
|
|
|
|
« Reply to How do you do CSS in WordPress?
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|