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! |
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.
|
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'); HTML Code:
$tag_title= get_bloginfo('description'); 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" ) { HTML Code:
if ( $bfa_ata['blog_tagline_show'] == "Yes" ) { |
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>'; } |
Did you try my answer? Maybe mine will win the contest.
|
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 |
I would use a width of 410px. That should work fine regardless of resolution and monitor size.
|
Thanks, Miles!
|
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 |
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! |
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...
|
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 |
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.
|
you could try this
HTML Code:
$tag_title= get_bloginfo('description'); |
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.
|
you would put it just where the other changes would be replacing the echo line
|
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" ) { HTML Code:
$tag_title= get_bloginfo('description'); |
Leave the if, replace just the echo line with that code
|
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);} |
oop, I had an extra '(' use this at 205-209
HTML Code:
if ( $bfa_ata['blog_tagline_show'] == "Yes" ) { HTML Code:
if ($bfa_ata['overlay_blog_title'] == "Yes") { |
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. |
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 |
Where do I enter this?
HTML Code:
15 this is my tag and this is part two of the tag |
This is the blog TAG general settings under BLOG Title
|
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! |
Hi Juggledad,
Can you just give me some pointers on how to style the taglines? Many thanks. |
wrap a div (with a class) around it and then add a selector and rules into the CSS Inserts
|
Where please exactly? If I wrap it around the tagline, the code itself appears on the page. If I go like this in lines 205 and further:
HTML Code:
if ( $bfa_ata['blog_tagline_show'] == "Yes" ) { Can you please be more specific? Which file, what code replaces what code? Many thanks |
that is because you are mixing php and html, you have to switch between them. That is why you see the '<?php' and '?>' in the code. This tells when you are using php and when you want just straight HTML
here is a quick lesson you can read http://www.build-your-website.co.uk/...-PHP-Part3.htm which I found on the web with a quick google search |
I studied the 3 lessons, and then copied the entire bfa_header.config.php to Homesite in order to get a good view of the structure. I noticed the entire document is within <?php and ?> so I am not sure where it would slip in and out of php. There are accolades in the file that are not mentioned in the lessons. I am sure I would be able to find how to style html within php but please don't overestimate me. If you could be more specific with regard to this code and the div it would save me a lot of time that I need to pass 1000+ html pages through this WP installation in the next weeks.
|
bfa_header_config.php is a bad example to look at, look at header.php you will see the escaping in the first 11 lines.
|
Yes, but I need to enter this code in the bfa_header_config.php, where all I see is if-statements. I appreciate your pointer, and I understand that I should be able to work this out by myself but I can't and I am giving up on this one. Thanks anyway.
|
juggledad thanks for a great tutorial.
For those that want 'multiline' taglines, I went one stage further, in this exampel I use |cr| as my delimiter in the tag line, though you could edit the code to use anything you like, so my tagline looks like this: line 1|cr|line 2|cr|line 3|cr|line 4 and prints out like line 1 line 2 line 3 line 4 so here is my code: (all comments appreciated!) at line 205 change to: HTML Code:
if ( $bfa_ata['blog_tagline_show'] == "Yes" ) { HTML Code:
if ($bfa_ata['overlay_blog_tagline'] == "Yes") { Hope it helps, Best Regards, Gordon aka The Digital Geek. |
All times are GMT -6. The time now is 03:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.