johnbailon
Forum Replies Created
-
Forum: Networking WordPress
In reply to: Plugin network activate/deactivate is flippedMarking as resolved.
Forum: Networking WordPress
In reply to: Plugin network activate/deactivate is flippedOh! So that’s how it works. My bad.
My understanding was when a network admin activates or deactivates a plugin, it activates or deactivates respectively the plugins on the other subsites. Thanks for clarifying Mika.
Forum: Networking WordPress
In reply to: Plugin network activate/deactivate is flippedYes, deactivated plugins on wp-admin/network show as active on regular websites.
Here’s a screenshot. On the left, you see the network admin’s plugins page with 2 plugins deactivated. On the right, you see the regular site’s plugin page with the 2 plugins activated.Am I SURE if they were network activated? No, I never said they were network activated. So actually, to workaround this bug, I don’t network activate plugins that I want activated on the regular sites.
Forum: Fixing WordPress
In reply to: Get Next 5 Posts from the Current PostThat’s untested code but I think that tells you the logic in it. I hope that helps somehow.
Forum: Fixing WordPress
In reply to: Get Next 5 Posts from the Current PostI think I can help you:
<?php $prevPost = get_previous_post(); $i = 0; $num_prev_posts = 5; while ($i < $num_prev_posts) //needs to check if $prevPost exists. while ($i < $num_prev_posts && !empty($prevPost)) doesn't work. { get_permalink($post->ID); //and other such functions that work on the global $post should now work. $i++; $prevPost = get_previous_post(); // and then there should be a check if $prevPost is empty or not } ?>
I used a while loop because there’s a possibility that there aren’t enough previous posts and so the loop should be able to end abruptly. I just don’t know how to check if $prevPost is empty,
!empty($prevPost)
or$prevPost != ''
won’t work. There’s not much documentation for get_previous_post() or get_next_post();