I need to create a page template that has an image and text with a common style. The image url must be set using a custom field (or something like it) and left aligned to the page title and content.

How can I create this custom page template and use a custom field to set the image url?

1 Answer 1


Create a Page_YourCustomName.php . copy page.php content to your new file. add the following code to first Line :

<?php /* Template Name: Your Custom Name */ ?>

Once you upload the file to your theme’s folder , go to the Page > Edit screen in your admin dashboard.

On the right hand side under attributes you’ll see template. This is where users are able to access your page templates.

then you would add metabox to your page/post in admin panel for use it to your template . please read this link to ( How to create metabox and use it )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.