All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.


Author Topic: Hacking Index page, bugging Navi  (Read 12474 times)

0 Members and 1 Guest are viewing this topic.

Offline Basilakis

  • Jr. Member
  • **
  • Posts: 39
    • View Profile
Hacking Index page, bugging Navi
« on: 05 June 2008, 21:31 »
Hello my friend,

Last days i am hacking my index.php of wordpress to produce a better blog type for my self.

When i added the following code

Code: [Select]
<?php
// I am leaving Outside Index page, the category named 63
   
if (is_home()) {
     
query_posts("cat=-63");
   }
?>


My NaviPagi bugged, and it is not doing anything. Even if it moves to the index.php/page/2 it stills shows the same posts into the page. The wired thing is that i can not get whta is wrong with the code :)

Regards,
Basilis

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,511
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Hacking Index page, bugging Navi
« Reply #1 on: 06 June 2008, 06:43 »
because your query_post parameters did not cater for paging. When the page is loaded, the first X number of posts that excludes category 63 will get loaded. This thread should help you http://forums.lesterchan.net/index.php/topic,814.0.html

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Basilakis

  • Jr. Member
  • **
  • Posts: 39
    • View Profile
Re: Hacking Index page, bugging Navi
« Reply #2 on: 06 June 2008, 09:32 »
Does not seem to me that i any of the codes there is working.

I add code like that

Code: [Select]
<?php
$paged 
intval(get_query_var('paged'));
if(
$paged == 0) {
$paged 1;
}
query_posts('orderby=title&order=asc&posts_per_page=3&paged='.$paged); ?>


and i get 3 posts per page as it was expected, but from post one to miss the title and same with pagination, it is not actually loading the data.

is there any possible way to add inside the pagination the category eclude.  ???

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,511
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Hacking Index page, bugging Navi
« Reply #3 on: 06 June 2008, 09:49 »
You need to place the code in archive.php as well.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Basilakis

  • Jr. Member
  • **
  • Posts: 39
    • View Profile
Re: Hacking Index page, bugging Navi
« Reply #4 on: 06 June 2008, 09:56 »
I did but nothing new happed actually.

Even if i do not have posts in the selected category i exclude it is still bugging.

I also can not see where the problem is regarding the plugin. Why it bugs when there is a category to exclude :/

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,511
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Hacking Index page, bugging Navi
« Reply #5 on: 06 June 2008, 10:02 »
I KNOW WHY! Because you check is_home(). is_home() refers only to the index page and hence it will only be called once, ie, In page 2, is_home() will return false and hence the query_post() will not execute. I think I answered someone on this problem before. Do a search around.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Basilakis

  • Jr. Member
  • **
  • Posts: 39
    • View Profile
Re: Hacking Index page, bugging Navi
« Reply #6 on: 08 June 2008, 12:33 »
Can not find anything similar at all :/

And in WordPressss Documentation i do not see any other way, to use that think  :o

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,511
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Hacking Index page, bugging Navi
« Reply #7 on: 08 June 2008, 13:39 »
Why do you want to do a is_home() if you want to exclude that particular category? If you are using the default theme, just putting the query_posts in index.php will do.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Basilakis

  • Jr. Member
  • **
  • Posts: 39
    • View Profile
Re: Hacking Index page, bugging Navi
« Reply #8 on: 08 June 2008, 16:29 »
Cause that is how it is refered to the maual :S

Code: [Select]
<?php
// I am leaving Outside Index page, the category named 63
 //  if (is_home()) {
   //query_posts("cat=-63");
 //  }
?>


<?php if (have_posts()): ?>
<?php while (have_posts()) : the_post(); ?>

How should i rewrite it, based on what u say?

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,511
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Hacking Index page, bugging Navi
« Reply #9 on: 08 June 2008, 16:53 »
Just use:
Code: [Select]
$paged = intval(get_query_var('paged'));
if($paged == 0) {
$paged = 1;
}
query_posts("cat=-63&paged=$paged");

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Basilakis

  • Jr. Member
  • **
  • Posts: 39
    • View Profile
Re: Hacking Index page, bugging Navi
« Reply #10 on: 08 June 2008, 20:10 »
Seems to work great with that, thx a lot for the tip mate :)

Keep up the great work ;)

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,511
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Hacking Index page, bugging Navi
« Reply #11 on: 09 June 2008, 07:51 »
no problem =)

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Basilakis

  • Jr. Member
  • **
  • Posts: 39
    • View Profile
Re: Hacking Index page, bugging Navi
« Reply #12 on: 11 June 2008, 09:23 »
Seems that it is getting difficult for me, and i can not find the problem this time. It is still keep NOT getting after the page 1, and even click to [2] it goes stays quering the [1]

i do that
Code: [Select]
<?php 
//Total Posts will be shown in the page
get_header(); query_posts'posts_per_page=6&cat=' $cat )
?>


and it is not working for a wiered reason now. I am not geting the home or anything :$

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,511
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Hacking Index page, bugging Navi
« Reply #13 on: 11 June 2008, 09:38 »
you need to add the paged code.
Code: [Select]
$paged = intval(get_query_var('paged'));
if($paged == 0) {
$paged = 1;
}
query_posts("posts_per_page=6&cat=$cat&paged=$paged");

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Basilakis

  • Jr. Member
  • **
  • Posts: 39
    • View Profile
Re: Hacking Index page, bugging Navi
« Reply #14 on: 11 June 2008, 11:15 »
hehe works great, exelt thank u ;)

Offline risingstar

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Hacking Index page, bugging Navi
« Reply #15 on: 08 August 2008, 12:51 »
Ah it's worked. Thanks Gamerz.  ;D

Offline sticker

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Hacking Index page, bugging Navi
« Reply #16 on: 15 November 2008, 01:04 »
i have the same problem, can someone tell me where i put that code into which php file.......sorry i really suck lol

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,511
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Hacking Index page, bugging Navi
« Reply #17 on: 15 November 2008, 09:05 »
that depends on your theme, I would say index.php

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.