Conditional Posts Loop based on Current User Can
-
I have the idea of what I’m trying to accomplish, and I believe that it’s feasible, but my lack of experience with PHP syntax is mucking it up. Here’s the basics of it, without a lot of backstory.
I would like to modify this part of the loop:
<?php if ( have_posts() ) : ?>
To run conditionally if
current_user_can('manage_links')
I tried a handful of attempts at if have posts AND user can manage links, but again I believe my syntax is incorrect.
If the user cannot manage links, I would like the loop to return the default message, which in my case is modified to be “You do not have permission to view this content.”
Please lend your thoughts.
Thank you kindly
CT
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Conditional Posts Loop based on Current User Can’ is closed to new replies.