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]
Macbrink
January 2nd, 2013 at 1:01 pm
You have some very interesting code snippets here. I’ll take this in consideration for Lazyest Gallery 2.0