Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   Dual Title Colour Problem (http://forum.bytesforall.com/showthread.php?t=18567)

simon_me Oct 4, 2012 02:11 PM

Dual Title Colour Problem
 
Hi there! Thanks for great theme firstly. But i have a problem with a dual title colour.
http://img-fotki.yandex.ru/get/6523/...2ac_ab3d8e48_L
I want to highlight my title like "com." - with one colour, "press" - with another.
I have read about firstpart code, but simply didn't find where to edit or paste it
Thanks

juggledad Oct 4, 2012 06:39 PM

The blog title is set in the virtual sub-template header.php and comes from a WordPress function. So you would want to replace that whit a hard coded text and put the two color code there.

simon_me Oct 5, 2012 02:04 AM

Thanks! I did
HTML Code:

<h1 id="sitetitle"> 
          <a href = "http://testagain.hostenko.com">
      <span class="firstpart">com.</span>
  press
  </a>
</h1>

But now it's some space after "com."
http://img-fotki.yandex.ru/get/6623/...3d6_25477669_L
How can i fix it?
Thanks

juggledad Oct 5, 2012 07:29 AM

Currently there is no way to do this. the code will split the title in half to have the dual color. So if your title is 15 characters, the split will be at 7

I'll create an RFE for this

jerryc Oct 6, 2012 12:18 AM

Quote:

Originally Posted by simon_me (Post 90867)
...

But now it's some space after "com."

How can i fix it?

To eliminate the space, try this code, with no spaces or newlines:

Code:

<a href = "http://testagain.hostenko.com"><span class="firstpart">com.</span>press</a>
If it works, please post the rest of the code to make it not split the color in the middle. I'd like to do something similar.

juggledad Oct 6, 2012 04:11 AM

jerryc: good idea, I had the same one and tried it but it doesn't work, the whole line becomes the same color.

jerryc Oct 6, 2012 09:35 AM

Quote:

Originally Posted by juggledad (Post 90945)
jerryc: good idea, I had the same one and tried it but it doesn't work, the whole line becomes the same color.

Me, too, jug. That's why I asked simon for the rest of the code. He got that part to work, and you and I got the space to go away.

Simon, did you do something else, like maybe in the css, to get both colors to show?

juggledad Oct 6, 2012 10:05 AM

it has to do with how the code that parses the dual color titles works and spaces that are added in. I've created an RFE asking for more control. see RFE 113-02: allow Dual Color to specify where the color change happens

simon_me Oct 13, 2012 02:57 PM

Quote:

Originally Posted by jerryc (Post 90939)
If it works, please post the rest of the code to make it not split the color in the middle. I'd like to do something similar.

no, all text became black

jerryc Oct 13, 2012 06:20 PM

Quote:

Originally Posted by simon_me (Post 91346)
no, all text became black

I've been thinking about this, but I haven't tried it yet. How about spanning the whole thing with a tag that says
HTML Code:

<span style = "word-spacing:0px;"> ... </span>
and leaving the rest of the code the way you laid it out.

juggledad Oct 14, 2012 11:34 AM

I've played with this and created an RFE asking for more control. Feel free to mess with the code and try different things, maybe you will find a way, but I think it has to do with the parsing of the code and what results. You will have to dig into the theme code.

jerryc Nov 5, 2012 10:42 PM

Quote:

Originally Posted by juggledad (Post 91371)
I've played with this and created an RFE asking for more control. Feel free to mess with the code and try different things, maybe you will find a way, but I think it has to do with the parsing of the code and what results. You will have to dig into the theme code.

I found a workable hack and posted it on this related thread.

troyp Nov 21, 2012 02:57 PM

The javascript doesn't look like it is checking for a preexisting span.firstpart so it will try to parse the text of the title anyway.

There's a bug in the code that inserts an extra space after the closing span tag in includes/get_javascript.php.

See this related thread with updated code to allow checking for punctuation. You could use this mod and add the period to the section of tests.


All times are GMT -6. The time now is 04:32 PM.

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