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 29, 2010 03:58 PM

Hi Juggledad,
Can you just give me some pointers on how to style the taglines?
Many thanks.

juggledad Sep 29, 2010 06:17 PM

wrap a div (with a class) around it and then add a selector and rules into the CSS Inserts

RHCdG Sep 29, 2010 06:54 PM

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" ) {
                                <div class="tagline">
                                $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);</div>
                        }               
                        echo '</td>';
                }

my website turns blank.

Can you please be more specific? Which file, what code replaces what code?

Many thanks

juggledad Sep 30, 2010 04:11 AM

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

RHCdG Sep 30, 2010 06:27 PM

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.

juggledad Sep 30, 2010 06:42 PM

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.

RHCdG Oct 1, 2010 04:43 PM

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.

TheDigitalGeek Nov 22, 2010 05:13 PM

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" ) {
//                                echo '<p class="tagline">'; bloginfo('description'); echo '</p>';
                                echo '<p class="tagline">';
                                $tag_title= get_bloginfo('description');
                $tag_title_lines = explode("|cr|", $tag_title);
                $i=0;
                  while($i < count($tag_title_lines)) {
                    echo $tag_title_lines[$i];
                    $i++;
                    if ($i < count($tag_title_lines)) {
                      echo "<br />";
                    }
                  }
                                echo '</p>'; 
                        }

and at line 342 change to:
HTML Code:

                if ($bfa_ata['overlay_blog_tagline'] == "Yes") {
//                        echo '<p class="tagline">'; bloginfo('description'); echo '</p>';
                                echo '<p class="tagline">';
                                $tag_title= get_bloginfo('description');
                $tag_title_lines = explode("|cr|", $tag_title);
                $i=0;
                  while($i < count($tag_title_lines)) {
                    echo $tag_title_lines[$i];
                    $i++;
                    if ($i < count($tag_title_lines)) {
                      echo "<br />";
                    }
                  }
                                echo '</p>'; 
                        }

there is probably a neater way to suppress the final "<br />" however it's late here and brain is half asleep! - see it in action here: http://worcesterrenewables.co.uk

Hope it helps,

Best Regards, Gordon aka The Digital Geek.


All times are GMT -6. The time now is 01:52 PM.

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