• I would like to display custom field under the post title (each post on each page). I found that I need to insert the following code: <?php the_meta(); ?> in the theme index.php file in the loop. However index.php of the twentyten theme has no loop!
    I suspect I need to modify the loop.php file but do not know. I am an absolute beginner to WP but try to modify the theme a bit.

    1. Can anyone advise on which files need to be modified?
    2. And also where in the loop this line of code need to be placed if I want the information to be under the post title.
    3. How/where can I style this custom field? Which class in CSS file?

    Any help will be much appreciated,
    Peter

Viewing 4 replies - 1 through 4 (of 4 total)
  • Before you do anything.. don’t edit the Twenty ten theme.
    Your changes will be over-written the next time you upgrade WordPress or the theme. For this reason, it is recommended that you consider creating a child theme for your customizations.

    Once you have a child theme set up, look for
    <h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>
    That line generates the title, you can insert your code underneath.

    Thread Starter TheElear

    (@peterpap)

    Christine, many thanks for the prompt reply.

    I will create the child theme. V good idea. Thnk you.

    Which file do I have to look for the line of code you mentioned?
    Is it the loop.php?

    Look at loop-page.php and loop.php

    Thread Starter TheElear

    (@peterpap)

    Many thanks Christine.

    Peter

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘where to add the_meta in the twentyten theme’ is closed to new replies.