WordPress.org

Ready to get started?Download WordPress

Forums

Can i integrate Table into single.php ? (3 posts)

  1. Abu Bakar
    Member
    Posted 1 year ago #

    Hello.

    I am creating a custom wordpress theme. I am using custom post types. These custom posts are being displayed with the help of a plugin "Types"

    These custom fields are being output on single.php like this.

    http://screencast.com/t/skslqVG7Q

    See these are not aligned.

    I want to make them align in the following way...

    http://screencast.com/t/qtoMJwKRR2Y

    Everything on a line.

    The second image has been aligned with the help of Table tags.
    Can I align my in the same way?
    Can i integrate Tables into single.php?

    here is the code that I am using.

    <?php echo(types_render_field("webinar-name", array("title"=>"webinar-name","show_name"=>"true", "alt" => "Webinar Name", "class" => "cf" ))); ?>
    
    <?php echo(types_render_field("speaker-name", array("title"=>"Speaker Name","show_name"=>"true", "class" => "cf" ))); ?>
    
    <?php echo(types_render_field("launch-date", array("title" => "Launch Date", "show_name" => "true", "class" => "cf" ))); ?>
    
    <?php echo(types_render_field("jvpage", array("title"=>"JV-Page","show_name"=>"true", "alt" => "JV-Page", "class" => "cf" ))); ?>
    
    <?php echo(types_render_field("price", array("title"=>"Front End Price","show_name"=>"true", "alt" => "Front End Price", "class" => "cf" ))); ?>
    
    <?php echo(types_render_field("commission", array("commission"=>"commission","show_name"=>"true", "alt" => "Commission", "class" => "cf" ))); ?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your posted code may now have been permanently damaged/corrupted by the forum's parser.]

    Anyone who have worked with Types Plugin before??

    Thank you in advance.

  2. barakadam
    Member
    Posted 1 year ago #

    If you want more control, retrieve the custom field values yourself, like this:

    get_post_meta($post_id, $key, $single);

    So you could do

    <table>
    <tr>
    <td>Webinar name:</td>
    <td>echo get_post_meta($post_id, 'webinar-name', true);<td>
    </tr>
    <tr>
    <td>Launch date:</td>
    <td>echo get_post_meta($post_id, 'launch-date', true);<td>
    </tr>

    etc.

    More info on get_post_meta() here : http://codex.wordpress.org/Function_Reference/get_post_meta

  3. Abu Bakar
    Member
    Posted 1 year ago #

    Ok. Thank you.

    Can i also output % and $ signs with my custom fields?

    % and $ signs are strings??

Topic Closed

This topic has been closed to new replies.

About this Topic