any solution to this

Discussion in 'PHP' started by mike4uuu, Jul 21, 2010.

  1. #1
    <?php if (get_post_meta($post->ID, "Author Name") != "") { ?>

    <font style="text-transform: uppercase;font-size:10px;"> <?php echo get_post_meta($post->ID, "Author Name", true); ?></font>
    <?php }
    else
    {

    <?php echo get_the_author(); ?>


    } ?>


    I'm trying to display author s name on my wordpress blog !
    When meta Author name is not available , i want to display the author who publish it ...
     
    mike4uuu, Jul 21, 2010 IP
  2. mike4uuu

    mike4uuu Active Member

    Messages:
    832
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #2
    <?php echo get_the_author(); ?>

    If i remove <?php , ?> the author name is not displaying ... if i insert <?php , ?> , its showing error....
     
    mike4uuu, Jul 21, 2010 IP
  3. gapz101

    gapz101 Well-Known Member

    Messages:
    524
    Likes Received:
    8
    Best Answers:
    2
    Trophy Points:
    150
    #3
    
    
    <?php 
    if (get_post_meta($post->ID, "Author Name") != "") {
    ?>
    
    <font style="text-transform: uppercase;font-size:10px;">	<?php echo get_post_meta($post->ID, "Author Name", true); ?></font>
    <?php 
    } 
    else 
    { 
    
    	 echo get_the_author();
    
    
    } 
    ?>
    
    PHP:
     
    gapz101, Jul 21, 2010 IP
  4. mike4uuu

    mike4uuu Active Member

    Messages:
    832
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #4
    I tried it b4 , its not showing the author name when meta author name is not available ..
     
    mike4uuu, Jul 21, 2010 IP
  5. prosta

    prosta Peon

    Messages:
    71
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I will think about it.
     
    prosta, Jul 22, 2010 IP
  6. mike4uuu

    mike4uuu Active Member

    Messages:
    832
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #6
    i got it ,, thanks
     
    mike4uuu, Jul 22, 2010 IP