Osclass forums

Support forums => Tips, tricks, and tutorials => Topic started by: trains58554 on December 20, 2012, 05:55:26 pm

Title: [Tutorial] Adding pagination links to the home page
Post by: trains58554 on December 20, 2012, 05:55:26 pm
Hi All,

Here is a little tutorial on adding the pagination links to the home page.

First you will want to open the main.php file in your theme folder.

Once the main.php file is open you need to find this line
Code: [Select]
<p class='pagination'><?php echo osc_search_pagination(); ?></p>
<p class="see_more_link"><a href="<?php echo osc_search_show_all_url();?>"><strong><?php _e("See all offers"'modern'); ?> &raquo;</strong></a></p>

Then replace the above code with this code
Code: [Select]
<div class='paginate'><?php 
     $params 
= array('total' => ceil(osc_total_active_items()/osc_default_results_per_page_at_search() ) );                         
     echo 
osc_pagination($params); ?>

</div>

After you make these changes you will see the pagination links on your home page.

Jay
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: Legion on December 20, 2012, 08:00:45 pm
thanks jay
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: classless on March 29, 2013, 10:38:13 am
hi jay

can i add more page numbers instead of 1,2,3 ?

thanks
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: saqibulhassan on April 09, 2013, 07:00:44 am
Thanks for sharing
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: Wayno on May 06, 2013, 05:29:21 am
Nice Jay, I'm using auto theme which does not contain the above code. Can i still add it some where in the main.php so it will paginate?
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: trains58554 on May 06, 2013, 09:50:09 pm
@Wayno,

I have not used the auto theme so I am not sure if it will work. You could try adding it and see if it works for you.

Jay
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: jaybee08 on May 08, 2013, 07:56:36 am
Hi Jay,

How can we implement this one using bender themes?

Thanks
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: romantica on June 15, 2013, 07:37:06 pm
thanks jay
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: vagabond on July 18, 2013, 03:01:17 pm
The twitter theme doesn't have those lines. How to do?
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: MouniJose on October 09, 2013, 12:49:13 pm
you will see the pagination links.
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: Nicolas30 on November 30, 2013, 01:22:14 pm
Hello everyone,

I applied this smartness and it walks for me (bender).

But instead of being aimed to the page2 ' page searches ', I would like to be aimed to page2 ' page home2 '.

Nowadays:
page1 (home) => page 2 (search/iPage,2/)
What I would like:
page1 (home) => page2 (home/iPage, 2/)

Thanks for your answers

Regards,
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: fog on December 16, 2013, 07:35:54 pm
Hi Jay, how to limit the number pagination? Osclass system already have the method for limit? (function in file core, or something already done)

Something pagination like this ( 1 2 3 4 5 ... 999 > ) ?

Thank you very much for this pagination method, works very good   :)


Hi All,

Here is a little tutorial on adding the pagination links to the home page.

First you will want to open the main.php file in your theme folder.

Once the main.php file is open you need to find this line
Code: [Select]
<p class='pagination'><?php echo osc_search_pagination(); ?></p>
<p class="see_more_link"><a href="<?php echo osc_search_show_all_url();?>"><strong><?php _e("See all offers"'modern'); ?> &raquo;</strong></a></p>

Then replace the above code with this code
Code: [Select]
<div class='paginate'><?php 
     $params 
= array('total' => ceil(osc_total_active_items()/osc_default_results_per_page_at_search() ) );                         
     echo 
osc_pagination($params); ?>

</div>

After you make these changes you will see the pagination links on your home page.

Jay
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: fog on December 16, 2013, 08:40:05 pm
I found a problem, when i click a number of pagination, in page search if i click filter for low price, the results is inverse, ads low price in last of the list (and vice versa).

Regards
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: zoopla on December 17, 2013, 02:15:31 am
Thanks for the tip :)
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: lourencohen on February 26, 2014, 09:49:54 am
Now that was an informative post to read on about how to add pagination links. The links you have shared above was very helpful to know about pagination and how to apply the same. You have explained it in a simple and brief manner.



Thanks
Lourene
microneedle derma roller (http://www.microneedlehelp.com)
Title: Re: [Tutorial] Adding pagination links to the home page
Post by: haryour on March 11, 2014, 12:26:31 am
@train
Good tip,
But if one click on a page number why cant it load the page clicked on mainpage instead of search page?