• Hello guys.

    I try to find some help on my own language forum for wordpress but still not found answer … (It’s also for apologize for my bad english..)

    So what ùy problem is about ?

    Firstly I need to describe how I’m working.

    My posts are made like this :
    ID (the number that wordpress generate)
    ID_special (a number that I choice – it’s a custom field)

    Unlike the ID my posts can have the same ID_special.

    I use this ID_special to find post that are the “same” content but in different state (different category in this case, even if they can have some categories in common).

    I don’t want my visitors see the same posts in different state. So I write a little function who take in parameter an array and a String.
    With this function I can prevent to have the same ‘ID_special‘ post into my output.

    In my loop I add all ID_special into an array. Then I use my function and if it return true (that’s mean the String (<=> ID_special) is already present in the array) I use continue; to skip this post.
    There is a problem if I do like this : if I write showposts=10 than it will be (10 – [number of same ID_special]) only on my out.

    To avoid this I write showposts=100, add a var that I increment if I don’t skip the post. So after a little if(var == 10) break;

    It’s working good, in my home page, where I use some loop with different categories.

    BUT : now I need to do the same for my archive or category page. It will work fine but the pagination will completly be destroy by how I’m doing with my home page if I use this work way.. And here is my problem.

    I look some things about pagination, offset, post__not_in and much more but I still not able to resolve my problem.

    It will be really more easy for me if I can edit/change some parameters into my loop (like if my function return true, increment the showposts param).

    This is all I think, really sorry for my bad english, if you don’t understand something don’t hesitate to ask me to explain better.

    Cordialy exotb

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter exotb

    (@exotb)

    A little up …

    Thread Starter exotb

    (@exotb)

    An other up …

    Steady on cowboy! otherwise your get the bump police on your case.

    Bumping is forbidden and moderators do regularly delete posts as a result.

    Thread Starter exotb

    (@exotb)

    1 post by day is not bumping for me, but if you say, I will stop this.

    But I’ll never got answer too.

    Sad.

    Okay I didn’t know all rules and the “no answer – first reply” rule especially.

    Most questions that receive little or no responses is normally due to the fact they are in the wrong category or because the question is someone what complex or populated with lots of text. Personally, while not a moderator here I would recommend that you try and make your question shorter with only the information people need. People, generally like to skim read and if there’s a lot of text they may not even read it at all.

    While the support is generally good on WordPress.org there are many other places you could seek advice, i.e WordPress Stack but ensure you read their rules too, to avoid disappointment.

    Thread Starter exotb

    (@exotb)

    Thank you about the trick simon 🙂 !

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Custom field, loop and pagination’ is closed to new replies.