Articles of private

Private Post BUT Public excerpt on Homepage

I’m building a website for a french school. My problem : part of the website content will be private. Me and some other specified users will publish private posts (posts that only the 600 already-registred users will be abble to see). But an excerpt of those posts (small photo+some text) shall be visible to any […]

404.php only works if I'm logged in. Everybody else redirects to wp-login.php – why?

I have this “Forum Engine” theme and want it to be private. (No it’s not bbPress, that was my first question too.) So the theme (Forum Engine) has a “page” called “Threads Index” that is static on the homepage. I set the page to “Private” and fine, the site is private and everyone gets a […]

Private pdf files

I would like to give access some private pdf files to only logged in users. I have this in my htaccess: RewriteCond %{REQUEST_FILENAME} ^.*(pdf)$ RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC] RewriteRule . – [R=403,L] But I want to restrict access only documents .pdf with name starts with “private_”. Example: private_document1.pdf and private_document2.pdf only have to be accessible […]

Manage Private Posts

I have a public blog but would like to have a section just for my own private notes? What is the easiest way to do this? Is there a way to make an entire category of post private?

read_private_pages capability not working for new role

I have created a new user role – vendor – with the capability to read_private_pages, but when I log in as such a user, and go to a private page I cannot see it. Here is my plugin code: function fc_add_role($role, $display_name, $capabilities = array()) { if (!empty($role)) { return wp_roles()->add_role( $role, $display_name, $capabilities ); […]

How to properly print a 404 error without redirecton? (i.e. keeping the current URL)

There are some pages on my BuddyPress install that I would like to hide by printing a 404 error. With the help of the following question: Redirect Restricted Page to 404 I came up with this code: global $wp_query; $wp_query->set_404(); status_header( 404 ); get_template_part( 404 ); exit(); Most of the page is hidden nicely and […]

How to control who can view certain pages in BuddyPress?

I would like to control who can see a page in BuddyPress and restrict anyone else from accessing it. Something along the lines of the following pseudocode: <?php if ( loggedin_user_ids==1,4,5,7 ) { ?> // Show page <?php } else { ?> // “You are not allowed to view this page” message <?php } ?> […]

Excluding private/protected posts via IP

I essentially want password protected/private pages/posts in WP to work as they currently do, but completely disregard the functionality for certain IP addresses. I’ve looked into filters/actions and don’t see anything that seems promising, again I would prefer to do this without creating a specific category or anything outside of the current functionality of this […]

How to show private flickr group on a WordPress site?

I have been trying to embed a flickr group within a WordPress site for our camera club using a plugin such as slicker flickr or awesome flickr gallery. I have no problems with showing a set of thumbnails of my own photo stream, galleries, sets, or of a group I am a member of. However, […]

How do I get next_posts_link to work with private posts?

next_posts_link and previous_posts_link don’t show pages or posts that are private. This question has been asked many times on WordPress forums with no solution. How do I get this navigation to show my privately published posts?