Welcome Guest, Not a member yet? Register   Sign In
Need help related to my codeigniter wallpaper script
#33

Hi again!

In the past months i understand a lot CI working mechanism and i like it a lot.

But now for the past 3 hours I can't find a solution for this problem:

PHP Code:
        <?php foreach ($categories as $k => $cat) { ?>
        <div class="item">
            <div class="thumbnail">
                <div class="pr">
                <?php $search_replace = array('{C_SLUG_FULL}' => $cat->cFullSlug'{C_SLUG}' => $cat->category_slug); ?><?php $front_link $this->route_links->build_link('category_page'$search_replace); ?>
                    <a href="<?php echo $front_link?>">
                        <img src="<?php echo $this->image_workshop->crop_image(ORIGINALS_FOLDER_WF '/' $cat->wallpaper_image_path400225$cat->wallpaper_crop_position'thumbnail'); ?>" alt="<?php echo $cat->category_name?>"/>
                    </a>
                    <h2 class="cat-page-index"><?php echo $cat->category_name?></h2>
                </div>
            </div>
        </div>
        <?php ?>


This line of codeĀ <img src="<?php echo $this->image_workshop->crop_image(ORIGINALS_FOLDER_WF . '/' . $cat->wallpaper_image_path, 400, 225, $cat->wallpaper_crop_position, 'thumbnail'); ?>" alt="<?php echo $cat->category_name; ?>"/> generates my thumbnails in this page https://uhdwallpapers.org/categories/

and what i need is to make it to choose the newest thumbnail not the 1st that was published when the category was created.

Can someone tell me how to modify the code to choose the newest thumbnail for every category? (i guess it is something related to order by or reverse for foreach, but i don't know how to implement)


Thank you!
Reply


Messages In This Thread
RE: Need help related to my codeigniter wallpaper script - by stand - 04-06-2018, 12:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB