コード例 #1
0
function show_resources_list($args)
{
    $loop = new WP_Query($args);
    while ($loop->have_posts()) {
        $loop->the_post();
        $id = get_the_ID();
        $file = get_post_meta($id, 'cwr_attached_file');
        if (!empty($file)) {
            //Not empty array mean Files and no space in a correct url
            $no_posts = true;
            echo "<div class='resources_box'>";
            echo "<div class='left'>";
            echo "<a href='" . $file[0] . "' target='_blank'>";
            the_display_image($file);
            echo "</a></div>";
            echo "<div class='res_title' ><a href='" . $file[0] . "' target='_blank'>";
            the_title();
            echo "</a><br><span>" . get_the_date() . "</span></div>";
            echo "<div class='both'></div>";
            echo "<div class='resources_content'>";
            echo "<p>";
            the_content();
            echo "</p>";
            echo "</div>";
            echo "</div>";
        }
    }
    if (!$no_posts) {
        //echo "<p class='data-no-found center'>please visit this page soon for information related to pre-breeding the wild relatives of this crop for climate change adaptation</p>";
        //echo "<p class='data-no-found center'>No resources found</p>";
    }
}
コード例 #2
0
        echo $file_url[0];
        ?>
" rel="bookmark" target="_BLANK" ><?php 
        the_title();
        ?>
</a></h2>
                <img src="<?php 
        bloginfo('stylesheet_directory');
        ?>
/images/file.png">
                <div class="thumb"><a href="<?php 
        echo $file_url[0];
        ?>
"  target="_BLANK">
                        <?php 
        the_display_image($file_url);
        ?>
                    </a></div>
                <?php 
        the_content();
        ?>
                <div class="post-meta">
                    <?php 
        if ($wpzoom_homepost_cat == 'Show') {
            ?>
<span class="category"><?php 
            the_category(', ');
            ?>
</span> <?php 
        }
        ?>