Show Lazyest Gallery Folders Only on 1st Page of Directory

Here I am altering a core file of the “Lazyest Gallery” Plugin by Macbrink. I want to show the sub-folders of a directory only on the first page of a paged directory. By default, the sub-directory folders will appear above the thumbnails. If you set pagination for thumbnails, the same sub-directory folders will appear on every page of the current directory. This is annoying in most cases.

The following code will set it to only show the sub-directory folders section on the first page of a paged directory. If you use this, make sure that you don’t activate pagination for ‘folders’. You should only be using pagination for ‘thumbnails’.

The file to edit is: wp-content/plugins/lazyest-gallery/inc/frontend.php

Open the file and find the following line of code. It should be about Line 760:

if ( ! $is_slide  ) { 
  

Now, replace that line with the following:

if ( !isset( $lg_pagei ) )
$lg_pagei = ( isset( $_REQUEST[‘lg_pagei’] ) ) ? intval( $_REQUEST[‘lg_pagei’] ) : 0;
else
$lg_pagei = intval( $lg_pagei );

if ( (! $is_slide) && ( $lg_pagei < 2 ) ) { //isa [/php]

NOTE: This code modifies the plugin core. If you do this, keep a change log of your changes. You’ll have to make these changes again after upgrading the Lazyest Gallery plugin to a new version. As always, modifications made to the plugin core will be overridden when you upgrade the plugin. The extra work is worth it to me, for a plugin that does what I want it to do. I keep a simple changelog, and re-doing the changes after an upgrade takes me about 2 minutes.

See more:

By

We've One Response

Questions and Comments are Welcome

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this:

[code]

YOUR CODE HERE 

[/code]