Advertisement:

Author Topic: [Tutorial] Adding pagination links to the home page  (Read 9063 times)

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
[Tutorial] Adding pagination links to the home page
« 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

Legion

  • Hero Member
  • *****
  • Posts: 622
  • I am founder of top20remedies.com buyeradvise.com
Re: [Tutorial] Adding pagination links to the home page
« Reply #1 on: December 20, 2012, 08:00:45 pm »
thanks jay

classless

  • Newbie
  • *
  • Posts: 10
Re: [Tutorial] Adding pagination links to the home page
« Reply #2 on: March 29, 2013, 10:38:13 am »
hi jay

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

thanks

saqibulhassan

  • Newbie
  • *
  • Posts: 2
  • saqib
Re: [Tutorial] Adding pagination links to the home page
« Reply #3 on: April 09, 2013, 07:00:44 am »
Thanks for sharing

Wayno

  • Newbie
  • *
  • Posts: 13
Re: [Tutorial] Adding pagination links to the home page
« Reply #4 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?

trains58554

  • Osclass contributor
  • Hero Member
  • *****
  • Posts: 3642
  • osCanyon, the class of Osclass
Re: [Tutorial] Adding pagination links to the home page
« Reply #5 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

jaybee08

  • Newbie
  • *
  • Posts: 22
Re: [Tutorial] Adding pagination links to the home page
« Reply #6 on: May 08, 2013, 07:56:36 am »
Hi Jay,

How can we implement this one using bender themes?

Thanks

romantica

  • Premium
  • Hero Member
  • *****
  • Posts: 1092
  • salut tout le monde
Re: [Tutorial] Adding pagination links to the home page
« Reply #7 on: June 15, 2013, 07:37:06 pm »
thanks jay

vagabond

  • Newbie
  • *
  • Posts: 1
Re: [Tutorial] Adding pagination links to the home page
« Reply #8 on: July 18, 2013, 03:01:17 pm »
The twitter theme doesn't have those lines. How to do?

MouniJose

  • Newbie
  • *
  • Posts: 3
Re: [Tutorial] Adding pagination links to the home page
« Reply #9 on: October 09, 2013, 12:49:13 pm »
you will see the pagination links.

Nicolas30

  • Sr. Member
  • ****
  • Posts: 295
Re: [Tutorial] Adding pagination links to the home page
« Reply #10 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,

fog

  • Hero Member
  • *****
  • Posts: 1062
Re: [Tutorial] Adding pagination links to the home page
« Reply #11 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

fog

  • Hero Member
  • *****
  • Posts: 1062
Re: [Tutorial] Adding pagination links to the home page
« Reply #12 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

zoopla

  • Guest
Re: [Tutorial] Adding pagination links to the home page
« Reply #13 on: December 17, 2013, 02:15:31 am »
Thanks for the tip :)

lourencohen

  • Newbie
  • *
  • Posts: 1
Re: [Tutorial] Adding pagination links to the home page
« Reply #14 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