Invisible/Conditional link to draft pages - wordpress

While writing new blog posts I occasionally hit keywords, that I want to write an other post in the future about. The post didn't exist right now, but creating a link (or anything that will become a link later) while writing the post, would make it a lot easier to reference to the future post than adding links later manually when the new post really exists.
I already thought about using drafts for this scenario and just create an empty post, but I couldn't find a plugin for displaying conditional invisible links to draft and visible links to finally published posts.
Any ideas how to address this issue?

Related

Wordpress how to generate list of revisions (post and pages) for public

I need to implement to Wordpress something like Public Revisions. The idea is that for every post and page there'll be a list of revisions (public, not only for logged-in) that allows reader to click to display previous version of post or page. So, I guess there should be a loop to check if there is a revision and print them while there are some. Making the list clickable, and showing the revisions would be awsome.
There was a plugin to do that, but it's abandoned and it doesn't work anymore. In fact, you can't even get it from the official list of plugins for WP.
Please help me achieve it the best (easiest) possible way. Unfortunately, my knowledge of PHP is only basic.
Dunno if you still need it but perhaps you could have a look at this?
https://developer.wordpress.org/rest-api/reference/post-revisions/#list-post-revisions
Seems like you could retrieve the data and create a page with it.

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

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.)

save copy of existing page as draft in wordpress?

I am using wordpress for a website. It's in development i do not have a link to it atm.
My customer would like to have his wife edit/correct the pages he writes, because he's dyslexic.
For new pages, it is simple: just save the page as a draft. Wife can log in and edit, visitors cannot see the page yet.
For existing pages, i don't know how to so that. Is it possible to
- change an existing page AND
- keep the existing page visible for visitors AND
- hide the updated page from visitors (keep it as draft)?
I prefer having a plugin/mod/extension that does this, but else i'll code it myself.
Thanks for your time.
Kim
Check out the Revisionary WP Plugin:
http://wordpress.org/extend/plugins/revisionary/
It creates a new user type: revisor who can suggest edits to existing pages that must be approved by an Admin or Editor, and also allows Admins and Editors to create draft copies of existing content to be published later.
This question has recently been discussed over at wordpress.se.com: https://wordpress.stackexchange.com/questions/3986/is-there-any-way-to-draft-a-revision-of-a-published-page-or-post-what-workaround
Unfortunately, there's currently no solution for it but to save the draft as a new page. According to the linked discussion it's possible to make a button that saves as draft, but you'd have to develop the plugin yourself.
If you click on "quick edit" in your page list, it will then give you the drop-down menu to change it to a draft. Took me a while to figure that out.
You can use duplicate post plugin. With the help of this plugin you can clone wordpress posts or pages easily.
Here is the link : http://wordpress.org/plugins/duplicate-post/
Revisionary is getting a bit old and buggy now, I'm finding "BU Versions" by Boston University a better alternative and looks to do what you wish.
It's not a very clean solution, but cut and paste from the published page into a new draft, call it "Draft of..." and keep it a draft for editing. When the editing is complete, cut and paste into the published page and update, then delete the draft.

Organising Custom Content for Wordpress

I am already very confused as I am typing this thread out. Please forgive me if my query is a little too difficult to understand.
I have an existing Real Estate Site that I intend to move 100% into WordPress. The existing site has one backend for listings and another blog section for reviews.
You can probably see why I have decided to make the move to a full WordPress powered site. Maintaining both ends of the site is both tedious & cumbersome.
I have read and understood Custom Post Types & Custom Taxonomies and how they work. I am rather excited about implementing them. However there is some content I am finding difficult to organise.
* An existing database table of about 4,000 Condominium Projects
Each entry in the Condominiums table has some "bio-data" like Year Completed, No. of Units, Facilities, Amenities etc.
Currently each listing in my site has an ajax query that fetches information from this table on demand.
In the new site, I intend to have a link to the respective condominium in each property listing.
This link should display information about the specific condo and display 'results' of matching listings.
Also, some condos have long article reviews done for them. In my current site, these reviews are displayed in the blog section. Separated altogether.
So here's my question.
How would I connect everything together. A duplicate perhaps? Taxonomy & Post for each condo? That will mean over 3,000 unique entries. Wouldn't that be an "overkill"?
If it is a taxonomy, the link will probably display all posts (listings) that have that condo name. But it wouldn't link to an actual page of either it's review or bio-data.
Any thoughts will be very much appreciated... Please feel free to ask if I have missed out any vital information!
Thanks in advance
The seems very straightforward to me and a perfect fit for WordPress (and I shudder to think of doing anything in Drupal you don't have too; and this from someone who developed in Drupal for 2+ years...)
Anyway:
Each condo gets stored in a custom post type.
All the "bio-data" gets stored in a custom field. Alternately you could create a taxonomy called "bio-data" and have a term value for each of the options but this won't work well for things like "SqFt" unless you do ranges (i.e. 1200sft-1300sqft) because terms can only be used for "true/false" attributes (i.e. either it applies or it doesn't) and not for specifics like exact offer prices, etc.
The long articles can just be stored in the "content" section of the condo post type (unless you have multiple per condo then you can either store in comments as #Jan Fabry suggested or you can create a custom post type "review")
Like I said this is really straightforward. Of course I've lived and breathed database apps for 20+ years so it comes second nature to me. Any questions, just ask...
This was how I managed to solve my own question!, Ironically enough, MikeSchinkel had an almost identical answer, so I accepted his answer instead.. So here's what I have:
A Custom Post Type for Condominiums labelled 'Reviews' in the admin section. The property 'Bio-data' is in custom fields. This Custom Post Type has a rewrite rule:
array( 'slug' => 'condominium' );
That way, I managed to have each Permalink to show something like:
http://domain.com/condominium/post-title
I have added a page called Condominiums and had it set to use a custom template - which basically shows the latest posts of condominiums with reviews. I also intend to extend the template for it to show a Search Condominiums function.
Added relevant taxonomies that can be searchable - like Brands & Developers.
I have already converted previous reviews to this. The last thing I will have to do will be to post all the Condominiums from the condominiums database to the wp_posts table using this Custom Post Type.
This is the part I am crossing my fingers for as I will have to see if the rewrite rules are going to significantly slow down my site as this will be 4,000 entries. This issue has been recently brought to my attention here
http://core.trac.wordpress.org/ticket/12935
I will update this thread once I have completed the importing - since this is the only place I have posted a question and have it answered - if anyone might be interested!
Thank you for your suggestions. I hope this helps someone else who is in a similar predicament.
Would it work if you view the Condominiums as posts, and the reviews as comments to these posts? This would keep them together, and is conceptually not even too far from the original intention. You can put the extra information in custom fields and tags (which gives you free searching capabilities). Then you should see for yourself if you still need to create a custom post type, or just do it with regular posts (why not?).
But yes, you are stretching the original WordPress concept a little. Drupal or some other CMS might be a better option, and have more plugins that are suited to your situation.

Resources