• Hi I’m not a PHP programmer therefore I’m do’t realy know what to do.
    I got a ready website to maintain and I’m having a problem.
    The website is bilingual and right now if I put a document to download in a custom fields it’s the same to both of a languages. I need to insert a code which will allow me to insert a different document to download to each language.

    This is the code I have right now.
    Thank you!

    <?php
    /*
    * Template Name: Downloads
    */

    $allow = (isset($_COOKIE[‘downloads’]) && $_COOKIE[‘downloads’] == 1);

    get_header(); ?>
    <div id=”main”>
    <div class=”content”>
    <?php while (have_posts()) : the_post(); ?>
    <h1><?php the_title(); ?></h1>
    <?php $posts = get_posts(array(‘category_name’ => ‘downloads’, ‘posts_per_page’ => -1)); ?>

    <ul class=”investor-list”>
    <?php foreach ($posts as $post) : setup_postdata($post); $custom_fields = get_post_custom(); ?>

    • <div class=”description-box”>
      <img class=”alignleft” src=”<?php echo get_bloginfo(‘template_directory’). ‘/images/icon-‘ . $custom_fields[‘icon’][0] . ‘.png’; ?>” alt=”” />
      <div class=”description”>
      <h2><?php the_title(); ?></h2>
      <p><?php the_content(); ?></p>
      </div>

      </div>
      <div class=”download-box”>
      ” class=”btn-download”><?php _e(‘Download’, ’tisteron’); ?>
      </div>

    • <?php endforeach; ?>

      <?php endwhile; // end of the loop. ?>
      </div>
      <aside id=”sidebar”>
      <nav class=”main-nav”>
      <?php
      wp_nav_menu(array(
      ‘menu’ => ‘Investors’
      )); ?>
      </nav>
      </aside>
      </div>

      <?php get_footer(); ?>

The topic ‘If condition to custom fields’ is closed to new replies.