Esempio n. 1
0
    /**
     * Display an optional post thumbnail.
     *
     * Wraps the post thumbnail in an anchor element on index views, or a div
     * element when on single views.
     *
     * @since Product Express 1.0
     */
    function project_express_post_thumbnail() {
        if ( post_password_required() || is_attachment() ) {
            return;
        }

        if(get_field('movie_link')){
            echo product_express_get_movie_thumbnail_by_url(get_field('movie_link'), get_the_title());

        }elseif(! has_post_thumbnail()){
            ?>
            <a href="<?php echo product_express_edit_param(get_field('link')); ?>" target="_blank" data-postid="<?php echo get_the_ID();?>">
                <img width="401" height="264" src="<?php echo get_template_directory_uri(); ?>/img/defaultImg.jpg" class="attachment-thumbnail wp-post-image" alt="default image">
            </a>
        <?php
        }else{
            ?>
            <a href="<?php echo product_express_edit_param(get_field('link')); ?>" target="_blank" data-postid="<?php echo get_the_ID();?>">
                <?php
                the_post_thumbnail( 'thumbnail', array( 'alt' => get_the_title() ) );
                ?>
            </a>
            <?
        }
    }
Esempio n. 2
0
        <ul>
            <li class="image">
                <?php 
    project_express_post_thumbnail();
    ?>
            </li>
            <!-- li class="title">
                <?php 
    if (!is_single()) {
        the_title(sprintf('<a href="%s" rel="bookmark" target="_blank"><h3>', esc_url(get_permalink())), '</h2></a>');
    }
    ?>
            </li -->
            <li class="url">
                <a href="<?php 
    echo product_express_edit_param(get_field('link'));
    ?>
" target="_blank" data-postid="<?php 
    echo get_the_ID();
    ?>
"><?php 
    the_field('link');
    ?>
</a>
            </li>
            <li class="tag"><?php 
    the_tags('#', ' #');
    ?>
</li>

        </ul>