I’m looking to have something made that allows inserting multiple existing posts into a new single post from the front end. Im using shortcode right now, the user can copy and paste it into a new post and it seems easy enough to me, but my client really wants a “click button to add to your post” which will accomplish the same.
The goal is for the user to assemble custom travel itinerary from a selection of locations. I would be glad to concider any alternative methods which could accomplish this.
I tried your shortcode plugin but it won’t work for me because it only works in a forum. The travel itinerary is premium content and the user posts have to be private, or in a private category. The original itinerary posts are protected files (S2 Memeber).
Please let me know if you might be interested, or could perhaps refer me to someone. I’ve explored literally over 100 plugins and nothing can do what I need.
If i were you, i’ll try to adapt this exemple to your needs…
in single.php i add this code before the comment template :
then in functions.php, i add this code :
Then if i display a post, when i click on the link the comment form is filled with
Wow, thanks! I’m really excited to try this. I’ll let you know how it goes. You’re a great help.
I tried it and of course it worked just like you said. However I probably didn’t communicate very well that it needs to be for many different posts. If I applied your solution correctly, it appears that it would always be the same shortcode copied into the comment feild?
My project involves what will be hundreds of posts, each being travel itinerary for a specific travel location. Each location-post could be as many as 10 pages. The user is supposed to be able to select as many as 5 or 6 locations, and combine them in such a way that they can be downloaded as a single pdf.
I figured blogging software could be a good way to approch it, and it works great simply providing shortcodes for the user to paste into a post and get 30 or 40 pages of selected content. However my client is stuck on wanting a button function that copies the content into the new post automatically. I just don’t see how I can do that.
But thanks so much just the same, I think I may have to just give up and tell my client we simply have to settle for my current solution. Seems we’re going to a lot of trouble for those few users who can’t copy and paste!
well, you can do a query_posts() outside of the loop and display boxes with a picture from the post and a button/link to add the content into the textarea. Using my example you simply have to make a foreach and then under the pic, you would have something like this :
nothing is impossible, it just takes longer 😉
Thanks, I tried it, but I can only add code for specific content if the code is added to a single post or page. I tried that but it only shows the code, so I assume this is supposed to go in functions.php or something. Then I realized you said I have to “query posts” and make a “foreach” which I would’nt understand how to set up, or even where to set it up.
I did look into it but there’s too much of the language I don’t understand, I’d have to back up and start from the begining. Unfortunately I don’t think I have time. I intend to learn
this stuff a little better eventually though. You’ve already been very helpful in that regard.
Okay, the query_posts() I think I can manage, but I don’t understand what the foreach actually does or why it’s needed. I’ve been trying to read about it but the examples aren’t making sence to me. Any good reference would be much appreciated.
may be you can try something like this :
I’m not sure if I’m using it right, it’s showing the links when I put it in single.php, but I don’t know where it looks for the shortcde, or where I should put it so it can be copied. Is it copied to the clipboard, or is it supposed to send it to the comment field?, or another post?
Okay, I added to functions.php:
var shortcode = jQuery(this).find(“:first”).val();
Then I added the most recent code you gave to single.php. It copies “[shortcode postid=’443′]” into the comment field, but [shortcode postid=’443′] doesn’t produce the post content when I insert it into a new post. Even if it worked, It’s still requiring the user to copy and paste, which is what I’m trying to elliminate.
I’m confused about how it’s supposed to work for my purpose, I don’t understand how I can get the shortcode to show up in a new post and produce the content. If that is what you intended, I have a feeling I’m not using this right, although I wouldn’t know. I’m not even sure if this is intended to be used with the previous code you gave, but it doesn’t copy-paste without it the function.php code you gave me.
I think I figured it out, I substituted the [shortcode postid=’443′]
with the actual shortcode for a plugin called “MindValley Include Post Content” so it’s now [mv_include id='<?php echo $post->ID;?>’ ]
and it does indeed auto-paste the code into the comment feild, I just wish the comment field could render the shortcode! or if the code could somehow end up in U can Post, or any kind of post field.
Even though I still have essentially the same issue I enjoy learning how to do this, pretty cool. Thanks.
In the code for functions.php, is there a way to substitute (“#comment”) with (“#post”) or (“UcanPost”)
I have UcanPost in the sidebar for single.php.
I installed a plugin which renders shortcode in the comments, it works! Now I really have something to work with! Heaps of Graditude to you imath.
I don’t know what happened, I deactivated BuddyPress and reinserted the code, but now it doesn’t copy anything into the comment field.
I did a new install of WP and tried it again, but still no copy happening. Maybe it only works with BuddyPress? I’ll reinstall it and try again..
Sure enough, now it works again. Strange, I don’t understand why because WP and BuddyPress both have single.php and functions.php.
Anyway at least I can now continue to ponder how this might work for my purpose.
I have a map of the U.S. I made in Flash. When you click a state, a box appears over the state with a list of all the travel locations in that state. When you click a location name in the list it opens a link to a post with itinerary for that location.
I need a similar way to organize the posts, so users can reference a single post and still copy it’s contents into a field along with the content of other posts. But how can I link to a single post which is being called in a query? It seems the query is what enables the copy-paste code to work. I’m stummped!
I actually found a plugin that claimed to put all comments together on a page, and it does, the only catch is the comments have to be made through a widget, and not the ussual comment field where my shortcode gets pasted!
ever get the feeling all plugins are designed to do everything except what you need them to do? It’s a conspiracy I’m sure!
I think I’ve been going at this too long, I’m going for a run.
If you care to take a peek, it’s a WP install specificlly for the purpose of figuring out this issue. The only plugins are
MindValley Include Content (page/post shortcode I’m using with your code.)
Shortcode Exec PHP (makes PHP work in comments)
WP Wall (shows most recent comments on a page, but only if they are made through a widget.)
- The topic ‘[Plugin: BP My Home] need custom work’ is closed to new replies.