Images in theme creation wordpress

1

I'm creating a wordpress theme for vans for changes, so I've created a page-vans.php page and I'm showing each category of small, medium, large and extra large van, I've attached a thumbnail image and this image is shown in the page index to when clicked on it lead to the selected van page (page-vans.php), the problem is, how can I add another image without being the thumbnail?

To be displayed on the van's single page?

I thought of adding the content of the page but then it would enter the_content () only that would only filter the image of the_content ()?

    
asked by anonymous 16.08.2017 / 13:27

1 answer

2

To solve this you could use custom fields. Using this approach, you can insert one more image into each post and call it into your theme normally.

There are several ways to do this, from a fully manual as well as others with the use of a plugin. I particularly use the Advanced Custom Fields . With it I create a set of fields and assign it to a custom post type or a page, for example.

ThiswaywhenIcreateanewoneoreditapostofthetypethatwassettocustomfieldthefieldwillappearforinsertionofcontent.

And in the theme I'll call the content field:

<?php 
    $imageURL = get_field('imagem');
    echo $imageURL;
    // ou simplesmente
    the_field('imagem');
?>
    
16.08.2017 / 14:17