Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter giuliacotta

    (@giuliacotta)

    @ank91
    Thank you for the link, but I don’t get how to fix it, I’m not a great developper ??

    @giuliacotta

    this plugin allows us to use a custom template instead of its own,

    lets create a new pdf_lv_template.php in our theme’s folder

    the code may look like this :

    <?php
    
    // file name : pdf_lv_template.php
    
    global $pdf_light_viewer_config;
    $pdf_upload_dir_url = $pdf_light_viewer_config['pdf_upload_dir_url'];
    
    if (!empty($pdf_light_viewer_config['pages'])) { ?>
    
        <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
    
            <div class="carousel-inner" role="listbox">
                <?php foreach ($pdf_light_viewer_config['pages'] as $index => $page) { ?>
    
                    <div class="item <?php echo ($index == 0) ? ' active ' : '' ?>">
                        <img src="<?php echo $pdf_upload_dir_url . '/' . $page; ?>" alt="loading image"/>
                    </div>
    
                <?php } ?>
            </div>
        </div>
    
    <?php } ?>

    above code just loop through linked images, u can add your own css classes to suite your needs.

    Now we can use this template by this short code:

    [pdf-light-viewer id="142" template="pdf_lv_template.php"]

    hope this helps. ??

    P.S. : updated the code , using bootstrap default Carousel

    Plugin Author antongorodezkiy

    (@antongorodezkiy)

    Thank you @ank91

    @giuliacotta hope this helps.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Web Layout problem’ is closed to new replies.