Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2012
    Posts
    41
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Link Color in PHP

    How could I make the word Messages a specific color? Similair to how I made the unread count string a color. How could I do something similair to Messages without using css? Thank you.

    PHP Code:

    <a href="<?php echo get_permalink($mngl_options->inbox_page_id); ?>">
    <?php _e('Messages''mingle'); ?>
    <?php 
    if ($unread_count 0
    { echo 
    "<font color=\"#f03\"><strong> $unread_count_str </font></strong>";} 
    else {echo 
    $unread_count_str;} ?></a>

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,632
    Thanks
    0
    Thanked 649 Times in 639 Posts
    The appearance of web pages is defined by CSS. If you want to define the colour of something then that's the way to do it.

    Asking how to do it without CSS is like asking how to run that PHP without a server to run it on.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    New Coder
    Join Date
    Jan 2012
    Posts
    41
    Thanks
    6
    Thanked 0 Times in 0 Posts
    If you know a way to do this in css then please tell me but I have tried and it is not working. that is why I was just looking to using font color tags I just don't know where to place them.

  • #4
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    without knowing exactly what the _e() function does, i'm assuming it's the wordpress function...

    did you try?

    PHP Code:
    <a href="<?php echo get_permalink($mngl_options->inbox_page_id); ?>">
    <?php _e('<font color="#f03">Messages</font>''mingle'); ?>
    <?php 
    if ($unread_count 0
    { echo 
    "<font color=\"#f03\"><strong> $unread_count_str </font></strong>";} 
    else {echo 
    $unread_count_str;} ?></a>

  • Users who have thanked jmj001 for this post:

    ccarrin2 (01-27-2012)

  • #5
    New Coder
    Join Date
    Jan 2012
    Posts
    41
    Thanks
    6
    Thanked 0 Times in 0 Posts
    That did it! Thank you!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •