Nobble
Member
Posted 3 months ago #
I made some tweaks in the P2 theme allowing users to make comments on other pages (not just the frontpage). What I'm having trouble with is when a new post is made, say on a category page, it doesn't automatically load the post into the stream as it would on the frontpage, you have to refresh the page.
Has anybody else tried tweaking P2 in this way with more luck?
I've played around with the JS and functions files and tried making alterations, especially by changing some of the conditional parameters (functions that require the frontpage to be the active page), but I haven't been able to solve it as of yet. Anybody had more success here?
Nobble
Member
Posted 3 months ago #
I got this working in a roundabout way (involves editing the theme files in some places). If anybody is interested leave a message.
echosintime
Member
Posted 2 months ago #
I WOULD LOVE TO KNOW!!! spent all day trying to find the answer!!!!
Nobble
Member
Posted 2 months ago #
update:
I thought I had a nice fix (I let the loop refresh every time a post was made) but it stopped working. It's very frustrating figuring out the code.
An even less prettier way would be to go into p2.js and add a page reload function every time a post is made (only if you're not on the homepage). This does make the entire page refresh (not ideal at all).
hope somebody figures out how to do this properly, imo they should be built in.
If I find a better way I'll post it here
Looking for this solution for a while. Ideally, posting on author page.
acousins
Member
Posted 1 month ago #
Is it necessary to have the new post load in the ajax way that it does on the front page? If not, then you can still have authors post from the author page by just including the post form. Unless I'm missing something.
<?php if( current_user_can( 'publish_posts' ) ||
(get_option( 'p2_allow_users_publish' ) && $user_ID ) )
require_once dirname( __FILE__ ) . '/post-form.php';
?>
dlopeman
Member
Posted 1 month ago #
Yup - don't see why that would not work... Although I don't know where else I would have it... unless I made a separate post page or something... But then you aren't really looking for P2 at that point.
I've changed my post-form.php file a LOT. I also changed the entry.php file (so it can just be called from functions.php - there's so much redundancy in that thing!)
Has anyone tried acousins' solution yet?