0

I would like to create a page template that will have two containers. Left one should be for text (it is a multilingual website so that is why I need a page template), and the right side should be for images which are the same for all languages. My question is, what do I have to create so a client can insert and edit images as he pleases? Do I have to create a post, a page or something else? It must not be indexed as itself. I am interested in "the right Wordpress way"

<div class="col-md-6">
   <?php the_content(); ?>
</div>
<div class="col-md-6">
   <?php // include images ?>
</div>
3
  • Do you use a multilingual plugin such as WPML? Commented Oct 27, 2015 at 17:24
  • I am a little unsure what you are trying to do. It seems like all the pieces you need are in place already.
    – s_ha_dum
    Commented Oct 27, 2015 at 17:26
  • I use Polylang, but I don't think it matters? A client needs to have a possibility to insert logos of his company partners in a page. Lets say he adds them in a page called Images. In page template Clients I will include Images in one div, and in the other div the_content (text) which will be different for every language. The client doesn't want any html code, shortcodes and similar stuff in editor. I hope this makes sense
    – Marko
    Commented Oct 27, 2015 at 17:35

2 Answers 2

1

Images (and other media) in WordPress are stores as attachments — which are a special native post type (more or less).

There are two common ways to display attachments in a post context:

  1. Include them in post content (individually or via gallery shortcode)
  2. Select one as featured image (aka post thumbnail) and have theme with support of the feature display it separately from content

So unfortunately natively there isn't a way to select multiple images with intent of displaying them separately from content.

However it is a common feature in custom fields frameworks. They often offer nifty interface options for it and store attachments IDs in post's meta data, from where it can be retrieved and used.

Personally I favor Meta Box, but there are literally dozens of alternatives floating around.

1

You need to add custom fields to your content post type.

I recommend using ACF that have a nice gallery field ready.

Your Answer

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

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