1
DevilsWolf
Wordpress posts paged
  • 2005/2/20 9:59

  • DevilsWolf

  • Just popping in

  • Posts: 2

  • Since: 2005/2/10


I'm trying to make wordpress devide my posts over multiple pages. Its too much to show 31 posts of one month on one page and if i just limit it to 10 then most people wont read any further :p.

I've enabled the "posts paged" option and read on the official wordpress site that you have to add the "posts_nav_link()" tag in index.php where you want your page navigations displayed.
Quote:


Displays navigation showing next and previous pages if the "posts paged" option is set. This tag should be inserted out of the Word Press loop (The Loop), usually immediately after it.


But where do I have to add it exactly? The index.php which they show in the documents of the original wordpress isn't the same as the one in the XOOPS module.

This is the index.php of the XOOPS wordpress module:
Quote:
/* Don't remove these lines. */
$blog = 1;
include("header.php");
if (preg_match('/DoCoMo/', $_SERVER['HTTP_USER_AGENT']) and file_exists(dirname(__FILE__)."/wp-ktai.php")) {
header('Location: ' . XOOPS_URL.'/modules/wordpress'.(($wp_id=='-') ?'':$wp_id)."/wp-ktai.php\n");
}
wp_head();
// Uncomment the next line if you want to track blog updates from weblogs.com
//include_once(ABSPATH.WPINC.'/links-update-xml.php');
if (file_exists(XOOPS_ROOT_PATH.'/modules/wordpress'.(($wp_id=='-') ?'':$wp_id).'/themes/'.$xoopsConfig['theme_set'].'/index-template.php')) {
$themes = $xoopsConfig['theme_set'];
} else {
$themes = "default";
}
include(XOOPS_ROOT_PATH.'/modules/wordpress'.(($wp_id=='-') ?'':$wp_id).'/themes/'.$themes.'/index-template.php');
include(XOOPS_ROOT_PATH."/footer.php");
?>


Did anyone find this out?

thanks in advance

2
DevilsWolf
Re: Wordpress posts paged
  • 2005/3/10 18:34

  • DevilsWolf

  • Just popping in

  • Posts: 2

  • Since: 2005/2/10


Allright, 20 days later....

Thanks to NobuNobu the developer of the WordPress XOOPS Module, I have found the answer. I thought I'd share it with you guys incase someone has the same problem.

In order to make changes to the index you can't just change the default /modules/wordpress/themes/default/index-template.php. You'll have to create a new directory in that same themes directory with the same name as your XOOPS theme (don't delete the default one). Then just copy the files you want to change (in this case index-template.php) from the default dir to the new theme dir you just created.

Edit index-template.php (in your new theme's dir) and add outside of the post loop (usually at the bottom). If you enter it within the post loop it'll keep repeating itself after every post, so make sure its outside the post loop.

Double check to see if you have your wordpress set to "post paged" in its options and it should work fine.

Again, all credits to NobuNobu for helping me out.

3
artigas
Re: Wordpress posts paged
  • 2005/3/10 18:45

  • artigas

  • Quite a regular

  • Posts: 208

  • Since: 2004/12/21


Greetings -

Is this enhancement available for downloading?

Thanks In Advance.

4
toddherrold
Re: Wordpress posts paged

thanks for the insights. unfortunately, i tried this but it didn't do anything. it doesn't seem like the addition of the XOOPS template directory in the wordpress theme directory did anything. do you have to "turn it on" or something?

5
annabloom
Re: Wordpress posts paged
  • 2005/3/12 3:12

  • annabloom

  • Just popping in

  • Posts: 7

  • Since: 2004/9/13


Quote:
this put into index-template.php outside the loop works fine, example.
i did not create a separate directory though.

6
Calipsy
Re: Wordpress posts paged
  • 2005/3/12 4:10

  • Calipsy

  • Just popping in

  • Posts: 87

  • Since: 2003/4/30


That's great. I did the changes and now I have my posts paged.

Thanks Devilswolf for sharing that!
That's the spirit!

7
toddherrold
Re: Wordpress posts paged

After several unsuccessful attempts I finally got it to work and thought it might be helpful to other newbies to post the exact code here. . . It will save you some time futzing with it. My index-template.php file within the new directory with the same name as my default theme is:

Quote:





',''); ?>



- @
















Sorry, no posts matched your criteria.



'); ?>

querycount; ?> queries. sec.
Powered by WordPress Module based on WordPress ME & WordPress




You can edit text within the quotes, so that the "separator" is anything you want. I chose ' | ' and the 'next' and 'previous' are likewise anything you want, like forward, back or whatever.

Login

Who's Online

178 user(s) are online (136 user(s) are browsing Support Forums)


Members: 0


Guests: 178


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits