• LJagermaster

    (@the-living-legend)


    Does anyone know how to (or if it’s even possible to) format specific words & sentences inside PHP files?

    I tried the standard method used in HTML pages (yes, I’m well aware that a lot of HTML standard coding isn’t supported in PHP files), for example:

    <font color=”red”>sample text</font>

    This doesn’t appear to be working with the text I’m trying to edit (it’s a line of text in my blogs footer.php, which the CSS file seems to be ignoring).

    Cheers guys ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • i would just assign a class to it and add it in the stylesheet?

    Thread Starter LJagermaster

    (@the-living-legend)

    Easier said than done… I haven’t a clue how to do that. Thanks for the tip though, I’ll try to work on it when I get the time ??

    Legend,

    seejee is very correct.

    There are many resources on the web to learn how to style HTML (XHTML) with stylesheets (CSS). A good place to start is with w3c.The WordPress documentation is also a good place to start. There are many more searchable on the web. This is what you need to explore to better understand and implement the changes you want to make.

    To leave you with an example, here’s what one would do to give some text in footer.php the color red:

    In the stylesheet, style.css, find #footer. Under that add the class ‘.change’, where you want text in that class to be red, like so:

    #footer .change {
    color: red;
    }

    In footer.php, add the class to the text you want to change (in this expample a line of paragraph <p> text will be red):

    <p class=”change”>Test of this change.</p>

    or, for just one word inside the paragraph text, use a <span> to assign the class, like this:

    <p>Test of this <span class=”change”>change</span>.</p>

    The output displayed will show the selected text as red color, while all other text is the original color.

    Again, this is just an example. I would definitely review the above resource suggestions first.

    As you probably know, it’s very wise to save the .php file or .css file text somewhere before editing the file, in case what you did causes problems and you need to go back.

    Good luck!

    Thread Starter LJagermaster

    (@the-living-legend)

    Thanks 11worth! That worked perfectly (took me a while to figure out the arrangement of the code, but the important thing is it works!).

    I am aware of the resources out there, problem is I don’t have the time just now to research them (I’m literally online only 2 hours a day), so you really helped me out there. Cheers bud ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Font formatting in PHP files?’ is closed to new replies.