WordPress.org

Ready to get started?Download WordPress

Forums

Custom Fields and Taxonomies in single.php (5 posts)

  1. ben1000
    Member
    Posted 2 years ago #

    Hi. I am having two problems. Maybe someone can help?!

    1. I am trying to get a custom field to show straight after the main body of text in single.php BUT before the Outbrain and Facebook Connect boxes. If I put the line to show the address above <?php the_content('Read the rest of this entry ยป'); ?> then it shows above the body text, if I place it below, it doesn't show at all.

    Is there any way to insert it into 'the_content'?

    2. I am trying to insert the value of a Taxonomy into the single.php template?

    In one place I need it so that the result is a link to all the results for that taxonomy, and in another I need it to be unlinked.

    Thanks

  2. keesiemeijer
    moderator
    Posted 2 years ago #

    More information is needed before anyone can help. Please provide a link to the page in question.

    In one place I need it so that the result is a link to all the results for that taxonomy.

    Do mean all the all posts of a taxonomy? Or do mean all the posts of a taxonomy term?

  3. ben1000
    Member
    Posted 2 years ago #

    For instance, here: http://www.touristisrael.com/hotels/mount-zion-hotel-2/

    I mean all the posts of a taxonomy term.

    Thanks!

  4. keesiemeijer
    moderator
    Posted 2 years ago #

    Try and make the term link with http://codex.wordpress.org/Function_Reference/get_term_link

    for the unlinked one use this:

    <?php
    // change  the term id 21
    // change 'hotel' to the taxonomy you registered
    
    $myterm = get_term( 21, 'hotel');
    echo $myterm->name;
    ?>
  5. ben1000
    Member
    Posted 2 years ago #

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.