Daughtery: Scavotto: i made a query that looks for pages that satisfy the requirement in $args. when i get_adjacent_postfalse, ‘’, true I get a previous page that isn’t within my query args
Diotte: When i try get_adjacent_posttrue, ‘’, true I get a trying to get property of non-object error
Teodoro: Ahhhhh you’re dealing with pages and parent pages. sorry you werent clear about that and I honestly didnt read your code line for line
Sarcinella: Can anyone tell me what i have to redirect to with add_rewrite_rule if i want it to redirect to a specific site?
Bonifer: Scavotto: sorry, didn’t know that was valuable information :
Firestein: I tried pagename=NAME and pageid=ID and things like this as parameter for index.php but Halcom worked
Alm: Scavotto: should I still use get_adjacent_post?
Fraint: Herbst0: what do you mean “as a parameter for index.php?
Wolter: HowardwLo: probably not
Malouff: Like: add_rewrite_rule’girls//*’, ‘/index.php?pageid=55
Vitiello: HowardwLo: can you give me the actual use case of this code? Where it is? etc
Booe: Herbst0: so you want to be able to go to something.com/custom and be redirected to something.com/index.php?pageid=55 ?
Wollyung: But no idea what parameter to use, or what i am missing
Cassese: Herbst0: why? what EXACTLY are you doing? This doesnt exactly make practical sense?
Harsy: Herbst0: why not just turn on pretty permalinks so your pages can be something.com/page-name ?
Polit: Because i have parameters
Carbonaro: Like something.com/something/PARAMETER1/PARAMETER2
Makofsky: Scavotto: it’s part of the page.php, I want my pages to have a step wise feel, like step1, step2. The index for these steps is a parent page. Since all of my steps are under the index, I figure I just query for post_parent = index page.
Lohrmann: But all are using the same template, maybe i am thinking to Rails’y tho
Biddy: And i use pretty permalinks
Tombleson: But just for the small part that is left that still is some kind of blog
Hollenbaugh: Herbst0: yea I think theres a better more “wordpress-y” way to do what you’re trying
Rollyson: But i cant create sites for every subdirectory, the theme i have now is based on that idea
Olp: Herbst0: let me just finish with herbst0 and then I can probably help you out. hard to do these two at once
Waaga: Scavotto: this code is at the beginning of the page, so my idea is to loop through the query to get the previous and next page links to populate my “next step” and “previous step” links
Atamanczyk: HowardwLo: So you dont have to do an entire loop for this necessarily.
Outcalt: Scavotto: no, ideally i don’t want to
Sunstrom: HowardwLo: but your code should be fine.
Dreesman: HowardwLo: you can just get_pages
Welty: HowardwLo: in fact. you can probably make this a nice little template tag for you to use where you need
Stavinoha: Scavotto: get_pages where?
Paysinger: Scavotto: i think the only problem other than messy/inefficient code is that I’m getting undefined offest
Troxell: HowardwLo: instead of using a new WP_Query
Landavazo: HowardwLo: you dont need all of the post data.
Thaler: Ah i see what you mean
Stoop: HowardwLo: your MAIN problem is messy/ ineffecient code.
Albanese: HowardwLo: which is what you came in here asking about. what is a better way to achieve what I have going on here.?
Fender: Scavotto: thats why i was asking for a refactor example
Jiminian: Scavotto: ya, that and I want to know why it’s offset error?
Wuensche: HowardwLo: offset error is irrelevant if you dont need to use it at all
Vuono: Scavotto: ok, so use get_pages
Vermont: HowardwLo: try this: http://pastebin.com/m3ZsWUg1
Schwarcz: HowardwLo: its basically a template tag so you can reuse this code anywhere in your WP templates. it separates your logic from your views which is nice no pile of junky args and if statements and lets you use the same function for the prev. and next