Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   Subdividing tagline over two separate lines (http://forum.bytesforall.com/showthread.php?t=9897)

RHCdG Sep 27, 2010 01:33 AM

Subdividing tagline over two separate lines
 
Hi,

I'd like to subdivide my blog's tagline over two separate lines, like so:

Hello [Blog Title]
I am fine [Tagline 1]
How are you? [Tagline 2]

Is there any way to accomplish this?

I asked this question before in another thread but that was for a previous version of Atahualpa.

Many thanks!

lmilesw Sep 27, 2010 04:54 AM

If you style the tagline width in ATO>Style & edit Header Area you can force the tagline to wrap. Just tweak it to the right width to wrap where you want.

juggledad Sep 27, 2010 05:20 AM

Well Larry beat me to one answer, so here is my answer

The tag line is displayed using the WordPress function 'bloginfo('description');' so it gets displayed in one line. Now there is another WordPress function 'get_bloginfo();' and you can use 'description' to get the tag line and put it in a variable
HTML Code:

$tag_title= get_bloginfo('description');
and then you could use the 'substr()' function to split it where you want it.
HTML Code:

$tag_title= get_bloginfo('description');
echo (substr($tag_title,0,10) . '\n' . substr($tag_title,11);

and of course if you ever changed the tagline, you would have to edit this code and change the location of the split.

But, since you are going to have to change the code if you change the tagline, why not just replace the code that is getting the tagline, with your tagline. ie.
if you look at bfa_header_config.php lines 205-207 (version 3.5.3) you will see
HTML Code:

if ( $bfa_ata['blog_tagline_show'] == "Yes" ) {
    echo '<p class="tagline">'; bloginfo('description'); echo '</p>';
}

you could change it to
HTML Code:

if ( $bfa_ata['blog_tagline_show'] == "Yes" ) {
    echo '<p class="tagline">tagline part 1<br>tagline part 2</p>';
}

This way you even save a little processing since you are not calling another function.

RHCdG Sep 27, 2010 06:48 AM

Thanks, Miles, and thanks, Juggledad, for your elaborate and impressive answer! However, it doesn't work :)
Do I need to turn off 'show blog title' in ATO>Style & Edit Header Area? The odd thing is, I did turn it off but it's still there! I also turned on the search box, but that one won't appear...

Oh, my website is at www.cornetsdegroot.com
And just to be sure, this is how lines 205-207 in the file bfa_header_config.php (version 3.5.3) now read:

if ( $bfa_ata['blog_tagline_show'] == "Yes" ) {
echo '<p class="tagline">Volledig werk en blogbiografie<br>van R.A. (Rudy) Cornets de Groot</p>';
}

lmilesw Sep 27, 2010 07:28 AM

Did you try my answer? Maybe mine will win the contest.

RHCdG Sep 27, 2010 07:43 AM

Hi Miles,

Yes, that does work! However, I am a little concerned about different resolutions, monitor sizes, etc.

Should I specify the width in the Tagline box like so:

margin: 10;
padding: 15;
font-size: 1.6em;
font-weight: bold;
color: #000000;
width: 500px;

You see, I want to break off the tagline at a specific point in the sentence, like so:

"Volledig werk en blogbiografie<br>
van R.A. (Rudy) Cornets de Groot"

Thanks,
Rutger

lmilesw Sep 27, 2010 09:11 AM

I would use a width of 410px. That should work fine regardless of resolution and monitor size.

RHCdG Sep 27, 2010 10:58 AM

Thanks, Miles!

juggledad Sep 27, 2010 06:11 PM

Sorry for the delay, I should have asked if you were using the %logo or overlaying the blog title on the header image.

The second area to change would be in bfa_header_config.php lines 342-344 using the same code as above

RHCdG Sep 28, 2010 02:21 AM

Hi Juggledad, Miles,

Now Juggledad's code works! I like Miles' approach for its simpleness and elegance. I also like Juggledad's solution because it gives more control, and e.g. allows you to style the individual taglines (I H1'd the 2nd line).

Many thanks to you both!

RHCdG Sep 28, 2010 07:25 AM

I had already marked this one as solved, but there is one issue with Juggledad's solution, which is when used in a multisite setup. The header then appears on both (or rather, all) sites. See www.cornetsdegroot.com and www.cornetsdegroot.com/rhcdg. Unless there is a way to work around this, I will have to revert to Miles' solution...

juggledad Sep 28, 2010 07:33 AM

You could possibly check the child site name and then have a tag line for each that you would split. That starts to be a bit of code you will have to maintain and replicate everytime there is a theme upgrade. The other way would be to make your tage something like this
HTML Code:

15 this is my tag and this is part two of the tag
where the number is where you wanted the split to happen. Then you could break the tag line in the code at that point

RHCdG Sep 28, 2010 07:40 AM

Thanks, Juggledad, but I lack the skills to implement either of the two options you suggest. Can you be more specific? Please let me know if you need any information that I can provide you with.

juggledad Sep 28, 2010 04:38 PM

you could try this
HTML Code:

$tag_title= get_bloginfo('description');
$tag_split=substr($tag_title,0,2);
echo (substr($tag_title,3,$tag_split) . '\n' . substr($tag_title,$tagsplit+4);


RHCdG Sep 28, 2010 04:43 PM

Thanks, I hope this is useful for other people who are better versed than I am currently. I don't know where to insert this code (file, line) nor how to modify it to my situation.

juggledad Sep 28, 2010 05:24 PM

you would put it just where the other changes would be replacing the echo line

RHCdG Sep 28, 2010 05:35 PM

In lines 205-207 as well as lines 342-344 of the bfa_header_config.php, I should replace

HTML Code:

if ( $bfa_ata['blog_tagline_show'] == "Yes" ) {
    echo '<p class="tagline">Verzameld werk en blogbiografie van<H1>R.A. (RUDY) CORNETS DE GROOT</H1></p>';
}

by

HTML Code:

$tag_title= get_bloginfo('description');
$tag_split=substr($tag_title,0,2);
echo (substr($tag_title,3,$tag_split) . '\n' . substr($tag_title,$tagsplit+4);

?

juggledad Sep 28, 2010 07:45 PM

Leave the if, replace just the echo line with that code

RHCdG Sep 29, 2010 03:13 AM

My blog won't show when I go like this:

if ( $bfa_ata['blog_tagline_show'] == "Yes" ) {
$tag_title= get_bloginfo('description');
$tag_split=substr($tag_title,0,2);
echo (substr($tag_title,3,$tag_split) . '\n' . substr($tag_title,$tagsplit+4);}

juggledad Sep 29, 2010 03:54 AM

oop, I had an extra '(' use this at 205-209
HTML Code:

                        if ( $bfa_ata['blog_tagline_show'] == "Yes" ) {
                                $tag_title= get_bloginfo('description');
                                $tag_split=substr($tag_title,0,2);
                                echo substr($tag_title,3,$tag_split) . '<br>' . substr($tag_title,$tag_split+3);
                        }

and this at 340-344
HTML Code:

                if ($bfa_ata['overlay_blog_title'] == "Yes") {
                                $tag_title= get_bloginfo('description');
                                $tag_split=substr($tag_title,0,2);
                                echo substr($tag_title,3,$tag_split) . '<br>' . substr($tag_title,$tag_split+3);
                }


RHCdG Sep 29, 2010 04:01 AM

Thanks, Juggledad, for following up on this one with me.
The site now appears but the tagline is not formatted and the first word 'Verzameld' is truncated ('zameld'). Also there is no split.

juggledad Sep 29, 2010 04:15 AM

did you put a number as the first two characters of the tag like I showed in post#12?? The number tells the code where to split the tag line

Try this tag line
HTML Code:

15 this is my tag and this is part two of the tag

RHCdG Sep 29, 2010 05:23 AM

Where do I enter this?

HTML Code:

15 this is my tag and this is part two of the tag

juggledad Sep 29, 2010 05:26 AM

This is the blog TAG general settings under BLOG Title

RHCdG Sep 29, 2010 05:43 AM

Alright! The split is now there! Only the formatting is missing... Care to take a look?
I need to leave, be back in a few hours. Thanks!


All times are GMT -6. The time now is 02:22 AM.

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