price next to listing title

Discussion in 'GeoCraft WordPress Theme' started by zweitbuch, Apr 17, 2014.

Thread Status:
Not open for further replies.
  1. zweitbuch

    zweitbuch Member

    Joined:
    Mar 18, 2014
    Messages:
    172
    Likes Received:
    1
    Hello guys,

    i would like to have the price of my listings displayed next to my listing titles in single listing page, you told me that i have to custom code sth up... so a freelancer told me that the following code should work (this is the line where the listing title is displayed)

    Code:
                <h1 class="title">Titel: <?php echo get_post_meta($post->ID, 3, true); ?> <?php the_title(); ?></h1>
    
    the word "Titel:" is displayed, but the get_post_meta doesnt work... could you probably give me a hint what is wrong with this code?

    thanks a lot!
     
  2. Nitesh

    Nitesh Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    5,165
    Likes Received:
    160
    Hello,

    Remove that code and replace title with code given below and add "html variable name" of your price custom field in place of 'geo_address' in the code given below.

    <h1 class="title"><?php the_title(); ?><span><?php echo get_post_meta($post->ID, 'geo_address', true); ?></span></h1>

    title.png

    You can format price field with the help of code given below.

    Code:
    .title span {
    color: blue;
    font-weight: bold;
    } 

    Thanks & Regards
    Nitesh Raghuwanshi
     
  3. zweitbuch

    zweitbuch Member

    Joined:
    Mar 18, 2014
    Messages:
    172
    Likes Received:
    1
    thanks a lot nitesh, thats exactly what i wanted ;)!
     
Thread Status:
Not open for further replies.

Share This Page