Post privacy in Wordpress - 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.)

Related

NextScripts SNAP : not using the permalink in wordpress?

This is in a way a followup of this question : Jetpack Publicize: Sharing only on Twitter for a category
I am currently working on a website in which one of the category only serves as a way to curate news on the net and then, share it on the front page and on Twitter.
The post itself is empty, I use a custom field to receive the URL from the user, grab a few things from the target website, update the permalink and save. Upon saving, SNAP publishes the post on Twitter.
My issue is that it is not using the permalink but the url of the post itself (which is absolutely empty). Having a look into the plugin's code, I saw that it was using post metas (most notably urlToUse, snap_MYURL) but couldn't determine if it was a priority issue or something else.
I also try to adjust my code to set these meta values to the url I want, to no avail.
Is there a way I could set my custom functions or the SNAP plugin so that the permalink is used ?
No answer after a week, neither here nor from SNAP's support. No problem.
The ugly patch I used :
Jetpack Publicize for all the Twitter updates
SNAP for the Facebook ones thanks to their ability of posting based on a specific category
It's bloated and I'd love to understand but, sometime, you have to ship

Manage custom content blocks on a page

I'm putting together my own Wordpress theme for a very specific set of client requirements. I'm fine with front-end theme work, but I need some help with back end.
The task is kind of like a support site, with lots of Q and A's. I'm building a support site for a company, which means most Pages will be populated with many questions and associated answers.
The page Structure would be something like this:
Home Page (with links to Most recent Q+As added) and common sections
-How to use the app (10-20 Q+As on page)
-How to manage integrations (10-20 Q+As on page)
-Other page (10-20 Q+As on page)
-5-10x 'Other pages'
About Us
Contact Support
Requirements and my comments
-Each Q and A does not have it's own URL
This makes using Posts for Q and A's unattractive.
-Each Page is made up of a Table of Contents which allows quick scrolling to questions
An ideal solution would be some code on the page theme template which grabs each "Q and A" object within a certain category/section/identifier and load it to the page
-New questions and answers can quickly and easily be added
The ideal solution for support reps is that they can add a question and answer, and assign a category, rather than edit a huge page of questions.
-Order of Q and A's on page is important
Ideal solution should allow you to order the Q+As within their given category/section/other.
-On the home page, most recent Q+As added list exists
-Each Page of Q+As has a "last updated" date, which is the date the most recent Q+A was most recently modified.
Ideas I had
Posts or custom posts seemed like a good idea, but they create permalinks. But my "Pages" would actually be Category Archive pages. We don't want a Q+A to be be assigned two categories. Also, custom post ordering seems difficult. If we could suppress permalinks and ensure on category or section and find a way to order them - this could work.
FAQ Plugins
It seems like these all are a bit clunky and the amount of custom dev to re-skin on it might not be worth it, might be easier to do something totally custom.
Question:
does anyone have any ideas how this could be achieved?
The best thing is to use custom post types. Basically two custom post types, question and answer. Then each question can have categories tags and so on. Answers can have a custom field with question ID so you can easily get all the answers by question ID. If you need then not to have unique url, than create two files: single-question.php and single-answer.php and put 404 page code there so if user will get to the url of a single question or answer than he will see 404 error :)

Wordpress: Comment on Archive Pages

I'm currently developing a Wordpress site/theme for a client.
He has a specific requirement to be able to add comments to an archive page - it actually needs to be a comment on the page itself, rather than the posts/products within that archive.
I effectively need a way to add comments.php to the bottom of archive.php, although I understand this won't work because an archive page doesn't have an ID for the comments to associate with.
Is there any way to give a category archive page an ID based on the category, and then hook the comments template into this ID for each archive?
Thanks so much in advance for any advice you can offer - it's been a long process and this is the last bit remaining to finalise the project!
Unfortunately it would seem this isn't directly possible, however for anyone who would like to do something similar, there is a third party comment solution called IntenseDebate which is suitable to be added to the archive pages.
If you use DISQUS, you can call the comments template using PHP to bypass WordPress checks and have comments on archives pages.
include 'comments.php';

private wordpress post

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.

How to create a simple company blog with a Tag-Cloud in Drupal-6?

I have to create a simple company blog within drupal-6. That means there should be only one single blog each user can post into.
What i have done so far is to create a custom content Type (blog) and a view that displays teasers of the recent blog entries with links to the full blog post.
Now i have to create a Tag-Cloud for this blog.
I created a taxonomy vocabulary for this "blog" content type and set the settings to Tags (Terms are created by users when submitting posts by typing a comma separated list.)
I also installed the Tagadelic Module and created a tag cloud with it, that works great and it displays all the Tags i entered when creating new blog entires.
But now to my problems:
First: If i click on an entry in this tag-cloud the default Taxonomy_term view is used to display the resulting blog entries. Thats bad because i would like to have it displayed the same way as in the view i already defined to show the blogs. Is there a way to use my view to display the results of the tag-cloud?
Second: On my view, below each blog-teaser should be a link to related blog entries (the ones that share the same terms). I do not have a clue how to do that.
is this even possible with the setting i have now or should i maybe take a whole other approach to create that company blog with tag clouds and related blog entries?
You should be able to solve both problems pretty easily, while keeping your current approach:
Take a look at your views list ('admin/build/views/list'). You should see a view called 'taxonomy_term (default)', which is usually disabled by default. This is an optional override of the built in taxonomy term page. You can enable this and configure it to look like the blog view you created.
Alternatively, you could leave that one disabled, but add another display of type 'page' to your already existing blog view, and configure that as an override to the built in taxonomy term. For this you'll need to set the path of that display to 'taxonomy/term/%' and adjust the display to use the term id argument as a filter (look at the above override for how this works).
You could also do it the other way round - use the default taxonomy_term override view, configure its output according to your blog view needs, and add another display for your recent blog entries to that. After this, delete your own blog view and use the new display of the taxonomy term override instead.

Resources