Kreirani odgovori na forumu

Pregledavate odgovor 1 (od ukupno 1)
  • Započinjanje razgovora rse

    (@rse)

    <?php
    /**
     * Template Name: Portfolio
     * Description: Page portfolio template with photos
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site may use a
     * different template.
     *
     * @link https://codex.wordpress.org/Template_Hierarchy
     *
     * @package
     */
    
    get_header(); ?>
    
        <div class="row">
    
            <ul class="grid">
    
                <?php $loop = new WP_Query(array(
                    'post_type' => 'portfolio_photos',
                    'orderby'   => 'post_id',
                    'order'     => 'ASC'));
    
                    while ($loop->have_posts()) : $loop->the_post(); ?>
    
                    <?php $portfolio_photos = get_field('portfolio_photos'); ?>
    
                    <li>
    
                        <a data-lightbox-gallery="gallery1" href="<?php echo $portfolio_photos['url']; ?>">
                            <img src="<?php echo $portfolio_photos['url']; ?>">
                        </a>
    
                    </li>
    
                <?php endwhile;
    
                wp_reset_query(); ?>
    
            </ul>
    
        </div>
    
    <?php
    
    get_footer();
Pregledavate odgovor 1 (od ukupno 1)