Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   [SOLVED] Post Title Colour (http://forum.bytesforall.com/showthread.php?t=12363)

Dave The Drummer Jan 21, 2011 12:58 AM

[SOLVED] Post Title Colour
 
I've been through the search and although there are plenty of options for altering the colour globally I can't find anything that allows me to change the title of a specific post.
I have an important announcement to make and I'd like the title in red so it doesn't get missed.
I don't want all of the posts to have their titles in red. Just this one.
I'd like it changed on the main page and the individual post's page.

I've tried putting the color command html (?) in the title box and it changes the colour OK but also adds in the original grey version and some extra characters which is messy and I don't understand why it does it.
eg. <span style="color: #ff0000;">blah blah blah</span>
That didn't work.

I've also seen the CSS inserts thing but I have no idea what they mean nor how to execute their intent. I don't know anything about the CSS concept structure.
I used to be a machine code programmer not a high level wizard.

Any clues ?
It's driving me bonkers.

Atahualpa 3.4.9
www.hampshireskeptics.org

GarethP Jan 21, 2011 03:58 AM

Not sure about changing just the one post's title - I'm sure there is a way though but you could make the post 'Sticky' and then style the box the post sits in at

Appearance / Atahualpa Theme Options / Style Posts & Pages / Post Container: Sticky

Would that work? I know it would keep the post at the top but you could make it 'Not Sticky' at some point in the future when everyone knows...

juggledad Jan 21, 2011 05:32 AM

The CSS rule would be 'color: #00ffff;' to make the text a bright blue, so how to construct the CSS Selector?

You need to specify the CSS selector so it points at the post. you do this by looking at the generated code.
HTML Code:

<div class="post-1538 post type-post hentry category-events category-hampshire-skeptics category-sitp category-urgent" id="post-1538">
  <div class="post-headline">               
      <h2>                       
        <a href="http://www.hampshireskeptics.org/?p=1538" rel="bookmark" title="Permanent Link to **Important Announcement** Change Of Venue!">**Important Announcement** Change Of Venue!</a>
      </h2>
    </div>

The text is part of a link, so you could code
HTML Code:

a {color: #00ffff;}
but that would effect every link. The link is a child of an h2 so you could use
HTML Code:

h2 a {color: #00ffff;}
and this would make every link that is part of an h2 blue. The h2 is a child of a div so you could add that and get
HTML Code:

div h2 a {color: #00ffff;}
but that would effect all div's, but it has a class so we could refine it to
HTML Code:

div.post-headline h2 a {color: #00ffff;}
which would cause all links that are h2's in a div that is a post headline, to be blue - not good enough, so looking on we see the post-headline is a child of the div with an ID+.

ID's are unigue on a page, ie an ID can only be used once on a page (classes can be used all over) so now you could use
HTML Code:

div#post-1538 div.post-headline h2 a {color: #00ffff;}
and any link that is an h2 in a div that is a post headline which is a child of a div with the ID of 'post-1538' will be blue.

since there is only one post with the ID of 'post-1538' this selector should only apply to one post title.

GarethP Jan 21, 2011 06:18 AM

I knew it would be something like that!!

Dave The Drummer Jan 21, 2011 07:51 AM

Thanks Juggledad. That makes complete sense.
But let me tell you where I am so you can see what I mean.

Imagine I ask someone for help to make my car go faster.
Someone provides me with a box to make it go faster. They explain how the box works. I understand it all. Power in, things happen to it that I understand and make sense and then the increased power comes out the other end of the box.
All above board, internally consistent and completely understood.

But I'm standing there next to my car that I understand completely and with a box in my hand that I understand completely and I have no idea how to make the box fit to the car.
Where does it go ?

The code makes sense, the logic is perfect, the exposition of why this way will work is logically consistent and without flaw that I can detect. The solution appears whole and eminently suitable for the job.

But where does it go ?

I can't see anywhere to put it.
See what I mean ?
That's part of my problem with high level languages in general actually. It's almost as if they've been "poofed" into existence and are hovering in codespace without support. I can understand them internally but cannot for the life of me understand how they can do anything at all.
6502 and Z80 8 bit CPUs if you're wondering.

Thanks guys.

juggledad Jan 21, 2011 07:57 AM

sorry, it goes in Ato->Add HTML/CSS Inserts->CSS Inserts

Nicely put cry for help :)

Dave The Drummer Jan 21, 2011 01:17 PM

Ahhhhh. Gotcha.
So things entered in that box appear to be a little like CSS interrupts in that whatever is entered in there overrides whatever is supposed to be controlling the formatting ?

It works fine on the main page but goes back to black on the post page I get to by clicking the post title on the main page.
Although this isn't really a problem as the information is highlighted where it needs to be which is where most people will see it.

Thanks for your help.

juggledad Jan 21, 2011 03:28 PM

Ahh that's because on a single post page the post title becomes an h1 so use this
HTML Code:

div#post-1538 div.post-headline h1,
div#post-1538 div.post-headline h1 a {color: #00ffff;}

and it will do it for both cases

Dave The Drummer Jan 26, 2011 01:28 PM

Ah ! Of course.
I didn't realise about the different heading sizes.
Thanks Juggledad.

Dave The Drummer Jan 26, 2011 01:36 PM

Ummmm.
Can't get it to work.
I've added in more lines with h3 h4 and h5 as well and no change.
Any ideas ?

http://www.hampshireskeptics.org/?p=1538

juggledad Jan 26, 2011 02:50 PM

Sorry I had a typo in post #8 - I just fixed it. Try that out.

Dave The Drummer Mar 2, 2011 03:12 PM

Apologies for not coming back sooner.
That works perfectly. Thanks for the help.


All times are GMT -6. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.