Simple PHP Help Please!

Discussion in 'PHP' started by wd_2k6, Apr 19, 2008.

  1. #1
    OK i'm using Wordpress but this can be done without knowledge of it i assume.

    I have: the_title();

    And 2 Custom Fields: $customa and $customb

    How do i make: the_title(); = $customa - $customb

    Please note the dash/hyphen inbetween the two words also.

    So say $customa was Blah and $customb was Boo the title would output as: Blah - Boo

    Many Thanks to anybody who can help in anyway!! It's really appreciated!
     
    wd_2k6, Apr 19, 2008 IP
  2. Xtrm2Matt

    Xtrm2Matt Active Member

    Messages:
    129
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Well, the_title( ); is a function, so I can't really help without seeing the whole function, but something like this:

    function the_title( $customa, $customb )
    {
    	echo "".$customa." - ".$customb."";
    }
    PHP:
    Then whatever you want the title to be, you would:

    the_title( "Blah", "Boo" );
    PHP:
     
    Xtrm2Matt, Apr 20, 2008 IP