Support » Fixing WordPress » Span tags in the Site Title and Site Description

  • Resolved soberbobo

    (@soberbobo)


    So what I want to accomplish is to make the first part of the Site Title larger font-size then the second half. i.e 3em for “Wordpess Site” and 2em for “by Robert Langley”. For the Site Description I want to break up a quote so its on two lines…..BUT I want to adjust the left margin just for the second line of the quote. Is any of this possible? I am not familiar with PHP so if it is a PHP solution(I imagine it is) I will need really simple “For Dummies” solutions. When I have added “span” tags to these two items in the theme customize section the “span” tags show up as text in the title and description.

Viewing 14 replies - 1 through 14 (of 14 total)
  • You can accomplish this using css if you are familiar with it.

    Without being able to add the span tags though how would I accomplish this? I feel am very competent with CSS not an expert but very familiar and comfortable. I am not sure how to target the specific words or letters without having the span tags in there.

    So if you understand how css works, then you understand classes, id’s and so on. WordPress uses php but most of what you will be looking at looks like html so it should be easy for you to understand. Here is a link that shows you how a Wp theme is designed and laid out.
    http://codex.wordpress.org/Site_Design_and_Layout

    I know how to add a span with a class and customize it but WordPress will not allow me to add a “span” tag to the Site Title or Site Description. Rather then rendering it as html it displays the text. i.e <span class="class">Site Title</span>By Robert <———displays like this on the live website, as opposed to rendering it as HTML.

    More than likely it will be in the header.php file and you should be able to see the html in there along with the php to do what you need to do. But you really should make a child theme and keep your edits there so you don’t lose them on an upgrade.

    http://codex.wordpress.org/Child_Themes

    So this may need to be moved to another category, but, I have a child theme. When I set up my child theme it only creates CSS files. How do I get PHP into my child theme?

    Copy the header.php file (or what ever file) from your parent theme into your child theme then edit the copy that is in the child theme. It will override the parent theme.

    Using an FTP just copy it into the child theme folder?

    Sure.

    Ok thanks, I’m going to copy this message to a Mantra Theme post. I dont see any solution in the header.php. I am using the Mantra theme so perhaps the Mantra forum will know where in the header.php I can resolve this. I greatly appreciate your help and your very timely responses.

    Your welcome and good luck. 🙂

    photocurio

    (@photocurio)

    Hm, I’m not sure graphical_force understood the OP’s problem. By default, html tags in the site title field will be spelled out on your site. You don’t really want span tags visible on your front page, but that is what will happen.

    You can put spans in your site description (Tagline), and style it using CSS. This works, except that the wp_title() hook also puts the tagline into your page title (on the browser window) on the front page, and there again, the viewer will see that pesky html code.

    For these reasons, I wouldn’t recommend putting any html into your site title or tagline.

    even though this was supposedly resolved, I thought I’d post the solution..

    In your header.php, replace this:
    bloginfo('description');
    with this:
    echo html_entity_decode(get_bloginfo('description'));

    brilliant @photocurio that indeed solves it and I also think that OP originally was looking for this 🙂

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Span tags in the Site Title and Site Description’ is closed to new replies.