Timeline for Only display sticky post or latest post in custom loop
Current License: CC BY-SA 3.0
36 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 22, 2015 at 18:09 | history | undeleted | Pieter Goosen | ||
Sep 23, 2014 at 3:54 | history | deleted | Pieter Goosen | via Vote | |
Sep 22, 2014 at 19:49 | comment | added | xtojump | My sticky posts can now only be opened when logged in (otherwise 404 error), even when the errors shown with wp_debug are cleared it still doesn't seem to show post ID 10, and on page 2 of posts the <pre> code is still showing even though I deleted it :/ | |
Sep 22, 2014 at 19:40 | comment | added | Pieter Goosen | I would start by first clearing these errors. Apart from that, you will need to dig into your theme to see what is happening. I'm of to bed now. Hope you solve this. | |
Sep 22, 2014 at 19:34 | comment | added | xtojump | "bp_setup_current_user was called incorrectly" and "wp_deregister_script was called incorrectly". Both in functions.php | |
Sep 22, 2014 at 19:29 | comment | added | Pieter Goosen | Yes, any error messages, warnings, notices. | |
Sep 22, 2014 at 19:21 | comment | added | xtojump | Ok I turned it on. Is there anything I should look for? | |
Sep 22, 2014 at 19:11 | comment | added | Pieter Goosen | One last thing, set debug to true in wp-config.php. | |
Sep 22, 2014 at 18:54 | comment | added | Pieter Goosen | Post 10 is missing, post 6 is showing in place of post 10. Post 10 is either not published, or it is somehow being removed with some other code, or some cache is showing this weird behavior or something funny is happening. Your code and my code is working perfectly on my side. Don't you have any other custom queries on your page that might influence and create this behavior. It has to be something else, because it is not my code, neither the code you've posted | |
Sep 22, 2014 at 18:26 | comment | added | xtojump | Yes, but the second sticky is shown nowhere on my site. | |
Sep 22, 2014 at 18:23 | comment | added | Pieter Goosen | See my last update | |
Sep 22, 2014 at 18:23 | history | edited | Pieter Goosen | CC BY-SA 3.0 |
Add edit 5
|
Sep 22, 2014 at 18:08 | history | edited | Pieter Goosen | CC BY-SA 3.0 |
Add edit 4
|
Sep 22, 2014 at 18:05 | comment | added | Pieter Goosen | Problem solved. Your first post that is displayed in your second loop is your second sticky post. I think you forgot which post you assigned as a sticky post. Open your website with a different browser. Please accept my answer by clicking on the check mark next to my answer. Thank you :-) | |
Sep 22, 2014 at 18:02 | comment | added | xtojump |
Shows: int(6)
|
|
Sep 22, 2014 at 17:56 | comment | added | Pieter Goosen |
Paste the following on the same place as before and post result <pre><?php var_dump($wp_query->posts[0]->ID); ?></pre>
|
|
Sep 22, 2014 at 17:53 | comment | added | Pieter Goosen |
OK, you must have a sticky post showing somewhere. The post ID is 6 , As you can see, only post ID 10 is removed and you have two stickies, ID 6 and 10.
|
|
Sep 22, 2014 at 17:50 | comment | added | xtojump |
array(1) { [0]=> int(10) } array(2) { [0]=> int(10) [1]=> int(6) } bool(false)
|
|
Sep 22, 2014 at 17:40 | comment | added | Pieter Goosen | Please see my update and comment and post results | |
Sep 22, 2014 at 17:37 | history | edited | Pieter Goosen | CC BY-SA 3.0 |
Add edit 3
|
Sep 22, 2014 at 17:09 | comment | added | xtojump | Aha! Clearing the cache made it work better! Just one thing missing: the stickies which aren't shown in loop 1 still aren't showing as normal posts in loop 2. | |
Sep 22, 2014 at 17:07 | comment | added | Pieter Goosen | I don't want to scratch around on someone's site, unfortunately. I can't think of anything now that might influence this. Clear all your caches, as well plugin caches if you are using cache plugins. Also test on a bundled theme | |
Sep 22, 2014 at 16:55 | comment | added | xtojump | I checked and I didn't use the code in edit 1 anywhere. If you want me to let you into the wp-admin I don't mind, email me: [email protected]. | |
Sep 22, 2014 at 16:52 | comment | added | Pieter Goosen | This is strange, it works perfectly on my site. You did not by change also use the code in edit 1. | |
Sep 22, 2014 at 16:40 | comment | added | xtojump | The sticky shown in loop 1 is also shown at the top of loop 2, and the other stickies which aren't shown in loop 1 don't show in loop 2. | |
Sep 22, 2014 at 16:34 | comment | added | Pieter Goosen | What do you mean by doesn't work. You will need to explain | |
Sep 22, 2014 at 16:29 | comment | added | xtojump | It doesn't work. I've updated my question with all the code I currently have. | |
Sep 22, 2014 at 15:14 | history | edited | Pieter Goosen | CC BY-SA 3.0 |
Change edit 2
|
Sep 22, 2014 at 9:47 | history | mod moved comments to chat | |||
Sep 22, 2014 at 9:35 | history | edited | Pieter Goosen | CC BY-SA 3.0 |
deleted 86 characters in body
|
Sep 22, 2014 at 9:14 | history | edited | Pieter Goosen | CC BY-SA 3.0 |
added 573 characters in body
|
Sep 22, 2014 at 8:59 | history | edited | Pieter Goosen | CC BY-SA 3.0 |
Add edit 2
|
Sep 22, 2014 at 8:36 | history | edited | Pieter Goosen | CC BY-SA 3.0 |
edit code
|
Sep 22, 2014 at 8:23 | history | edited | Pieter Goosen | CC BY-SA 3.0 |
Correct syntax
|
Sep 22, 2014 at 8:09 | history | edited | Pieter Goosen | CC BY-SA 3.0 |
Add edit
|
Sep 22, 2014 at 7:50 | history | answered | Pieter Goosen | CC BY-SA 3.0 |