private wordpress post - wordpress

Is it possible to create a category/post that will not show in the post listing but the post will be available via direct link.
Basically, I want the post/page/category to be viewable only by those I sent the link. I don't want to make it available in the post listing. I don't want it password protected also.
If possible that that the specific post is not visible to search engine, that's much preferable.
Thanks

Yes there is. You could always:
1) Register a Custom Post Type. In this example, we would name it something like "Private".
2) Set up your archive template (archive-private.php) to either redirect to a different page (maybe homepage, or 404), or style it in some way to look like a different page (maybe homepage, or 404) so the posts can't be listed
3) Set up your single post template (single-private.php) to format and display your private post however you like.
You wouldn't have to worry about your existing queries targeting any private posts, no passwords would be required, and the single-posts will be viewable and the archive not viewable. The nice thing too is that if you set 'public' to false in your arguments, the posts won't show up in any searches within the site.
As far as hiding it from search engines themselves, you need to set that within your Robots.txt File.
Bear in mind, this won't PREVENT Search Engines from displaying what's in your Disallow list. It is up to the Search Engine itself as to whether or not it will honor your disallow list.

No, there is not. If there is a way, you'd have to extensively modify your theme's PHP settings.

Related

Permalink Goes to Old Page

I have been working on a site created by another developer. I have been fixing the site to make it more visually appealing. I am also responsible for adding new events and pictures which i self taught myself to do.
I have a situation where I have a page with the following permalink:
http://www.cic-nj.org/events/
The problem is that this link goes to a page that does not show the edits that i am making under that page and there is no other page listed that shows the info it actually displays.
this is what I have in the editor box on wordpress that I want it to show.
enter image description here
this is what appears when url is used or when i click view
enter image description here
I have been sure to click update and renewing page to view it. it's like its going to a ghost page i can not edit.
Can anyone point me in the right direction on this?
Thanks in advance...
You are experiencing "slug collision": more than one thing in your WP install has the same slug.
The problem that you have is events is a custom post type, with a slug set to events - therefore the url http://www.cic-nj.org/events/ is directing to the listing of events. This is an automatic feature of WordPress. (Note - you can see more details to support this conclusion by the fact that you've got individual events accessible at url's such as http://www.cic-nj.org/events/blue-apron-info-session/ )
Note that custom post type slugs will always take priority over a page / post slug.
You have a couple of options:
If you want a page to display the content that you've created, the page's slug / permalink must be different than events
If it's acceptable, you can rename the slug of the "events" custom post type to something different. This has the potential consequence of losing SEO "juice".
If it's acceptable, you can remove the custom post type, if you aren't going to use them any longer.
NOTE: It may be tempting to ask "how do I remove the custom post type", or "how do I change the post type slug". Those are different questions, and if you need to ask, they should be asked in a different question - not added as a comment below.

How to manage Multiple single page through single.php?

There is Post that have certain data could be viewed in blog nav-menu that is using index.php and for the single post it retrieves data from single.php. I also have another custom post type that is client could be viewed from Our- client nav menu and it is using client template. Now the problem is i also want a custom single page for single client so i am using single-client.php but when i click to any client it leads to single.php not single-client. php.
You can use single.php and both post types will use it, as long as you remove the other two files from your theme.
Then you could fetch different template parts depending on the post type being queried.
However you do it, you're going to need separate files with stuff for the two different post types, unless the to are going to have the exact same design.
EDIT
I think I may have misunderstood.
Is your issue that the single posts are not displaying, but you want to keep using the two separate single templates?
In that case, make sure the post types are called blog and client.
To check, go to each post type's section in the admin panel. On each of these pages check the post_type URL parameter in your address bar.

Set the permalink to any domain in Wordpress

Is this possible to achieve without too much effort or a plugin? It's simply to instantly redirect to a site I've made in my portfolio if the post doesn't have any content.
Note that I don't want a script in the actual post to redirect since I only use Wordpress as the backend and fetch all the data to be used by a JavaScript backbone app.
EDIT : Added some extra info in a comment
Short Answer: No. You cannot set your Post Permalink to an external asset without directly editing the database.
Long Answer: First off, you need to understand the purpose of the Permalink. It isn't just an arbitrary link to somewhere. It's reserved specifically for storing where that specific post lives within the context of your Wordpress installation.
Your post doesn't live on example.com. It has its own ID, and Wordpress has a specific spot set aside for it where it can be seen on YOUR domain. Leave it as such.
Instead, what you should be doing is employing the tools Wordpress gives you to achieve what you want. A Plugin doesn't exist for what you want because - quite frankly - it's a fairly trivial task when approached CORRECTLY and doesn't warrant the use of an external resource.
So what's the correct way?
Use a Custom Field. Name your Custom Field something like 'externalHref' and fill that in with your link to the website you want to point to in case there's no post content.
Then in whatever templates you're using to generate your posts, just check either for the existence of your Custom Field called 'externalHref' or check for the non-existence of Post Content. In either case, instead of generating a link using The Permalink you can simply build a link that points to wherever you need.

Make content visible only to author in Drupal

I want to allow members of a Drupal website to upload their own content to the site (something like a blog post or questionnaire), but have it visible only to themselves (hidden from other members with the same role). The idea is to have them store some personal content that other members don't need to see, but that only the author member would need to see (or have access to) when using the site.
What modules would I need to use? Or how could I go about setting that up?
You can do this easily with http://drupal.org/project/content_access
I don't know if you've already solved this problem, but I recently did something similar with a shared blog in Drupal 7. I wanted users to have both private and public blog posts. I used the Save Draft module (http://drupal.org/project/save_draft) to add an extra button to the content editing screen, which I called Save (Unpublished) rather than "Save Draft" -- I used the String Overrides module to make that happen (http://drupal.org/project/stringoverrides). In the admin panel for permissions, Authenticated users were granted to right to view and edit their own unpublished items. Users could thus save their blog posts in a way that others could not see them. Then I used Views (http://drupal.org/project/views) to create a list view that used the criteria content type = blog, state = unpublished, and content author = current user. This gives users a list of their unpublished blog posts.
The https://drupal.org/project/view_own module handles this exactly the way you are looking for.

Post privacy in Wordpress

Can a post be hidden from home page, archive view, category lists etc. and viewable only if you have a direct link to it? The blog doesn't have registered readers and is open to public so that would be a mean of hiding some posts from public view without using the password protection.
I asked this question in Wordpress section and the idea there was to use conditional code so I'm asking the question here as well to get closer to the code.
If I used conditioning, would I have to input each post's ID separately to PHP file for archive, categories, search and such?
EDIT:
After reading a bit more all over, I had an idea of creating a private category and then use some kind of conditioning so that posts from that category are hidden. According to Codex, certain category can be hidden from, for example front page but I don't know if there's a way to hide it altogether except when you have a direct link.
Creating a "Private" category is a good solution. It is quite possible to hide this category altogether except via direct link. You just have to "block all the exits" with conditional code.
The default WordPress theme displays posts via the Post Loop. See http://codex.wordpress.org/The_Loop, especially the section entitled "Exclude Posts from Some Category". Just find all the places in your theme's PHP files (e.g. index.php) where this loop is used, and add the conditional code. You'd also need to filter your category list and blog archives in the side menu. Don't add filtering in single.php, otherwise the private post won't display on its own page.
You'd probably want to add a similar condition to filter search results so that private posts aren't leaked via the blog's search tool. There may be more "exits" I haven't thought of, but I'll be sure to update as I do. I'm glad to look at specific code if you so desire.
Understanding WordPress' post query and loop really opens up a world of possibilities for customization.
I found the simplest way - just use Simply Exclude Wordpress plugin. It has the option to exclude each post (or tag, for that matter) from front page, archive, search or feed. It works flawlessly. You can still view the posts by using direct links.
(Not actually an answer that includes code but a working solution nonetheless.)

Resources