Button that publishes scheduled post in Wordpress when clicked? - wordpress

I'm looking to create a button for a Wordpress site to display in the top corner of the page that says "Click here if this site hasn't been updated since your last visit." Clicking this would trigger the next scheduled post to automatically be published instantly. If there are no scheduled posts, the button will take the visitor to a random post from the archive.
I want to avoid one person being able to click this button over and over. I'm a complete newbie to programming so I'm just hoping someone can point me in the right direction. I don't even know what to learn in order to be able to make this, so any hints would be hugely helpful. Thanks!

Look into the Wordpress documentation. http://codex.wordpress.org/Function_Reference contains all the Wordpress php functions. You are going to want to get a basic understanding of php. I'm not sure on the scheduled post part, but to get a random post you need
query_posts('orderby=rand

Related

Place order button to automatically download

I'm new here and was directed to try this forum for my quandary with WooCommerce.
I’ve created downloadable products that are free. – I’m using Storefront WooCommerce Theme for WordPress.
– Before the download is available I would like the users information ie: email, name. I’m using the checkout page (place order) for this and bypassing the cart. So instead of collecting payment I’m collecting contact info. I have customized that page and buttons to only gather the information required for download.
– Once they enter the information they are able to download the file, but only from a different page (another click). I’d like download to automatically download on the place order button click.(I've changed the text to read: download specifications)
In summary:
– I would like to have the file download automatically without the place order summary page more of a thank you for your interest page.
Any suggestions would be much appreciated. Thank you again for any help you can give me.
I'm not sure why the negative votes, I thought this was a place to share and find answers.
I did a work-around which works for now. I may revisit this later. There are still 3 clicks but the flow is a lot nicer.
• I copied the woo thank you php check out template to my child theme and made some custom changes to eliminate the extra order information
• changed button title for smoother flow while still gather the user information in my order information.
• I can trim the template even more but that will take a while because the download function is attached to the order table which is actually the information I want to record.
• Then, I thought about attaching a form to the button at the single product page to capture the user info but that opens another can of worms in record keeping since it won’t populate the order table.
What I wanted to do requires lots of heavy lifting which will take some time for me to figure. If I come up with the answer to my original question I will share with the forum.

Archive counter increasing every time I publish a blog post

Every time I publish a blog post, the archive counter sees that as a new item to archive.
I think this might be a bigger problem though. If I have an existing blog post and want to make changes, pressing "save" does not save the changes. I have to go and actually publish the post again. Is there a way around this? Is there something I'm not doing in the content type definition?
Thanks in advance.

What is the best way to implement pagination in web?

Recently, I am developing a self-using blogging system, but I have some questions about the implementation of pagination.
The pagination I want is :
10 results per page
When user visits the home page(/), he/she could see the current page he/she is at(in this example is page one), and if there are more than 10 results, then he/she could be able to see the 'Next' Link.
If there are some results before this page, and there are also some results after this page, then this page should have 'Prev' and 'Next' Link and the current page number.
This thinking appeared when I was designing the algorithm about pagination:
If I want to implement this functionality, I need to know the total numbers of published posts.(If it is not published, it shouldn't be displayed), so maybe I need to write this SQL code :
SELECT COUNT(*) FROM post WHERE published IS NOT TRUE;
And I could pick the result above and the current page number the user is at to compute the pagination result.
But the question I want to ask is if there are many records , performance will be very terrible, how could I make this program more faster?
I see the pagination of a blog that has thousands of post and is built on top of WordPress is very fast, I want to know how could I archive this speed ?
Thanks a lot.
go through this sample PHP Pagination coding. Results won't be slow because of the LIMIT n,n+RecordsPerPage part of the mySQL query.

How to use the Concrete5 "Page Rating" Add-On

I have a page that shows search results containing pages that matched the search criteria. All of the pages returned are the same type of page (e.g., a person's profile). I want to add a star rating system to it so users can rate the profile.
I've tried adding a custom page attribute and updating it using the output rating helper but that didn't work. It looked like it worked but when I refreshed the page it just went back to whatever the rating was set to originally.
So, I added the "Page Ratings" add-on (https://www.concrete5.org/marketplace/addons/page-ratings/) and installed it. There are supposed to be 2 blocks associalted with it. I'm assuming the list block is the one I need in my case. However, when I go to the page and try to add one of those blocks to my area I don't see them listed. Does anyone know how to use this add-on? There is barely any documentation for it.
You do realize this is a "pay for" application? As such, most of the Developers that do charge for their add-ons are very responsive. Not to push you away from here, but if you have a problem with the installation, payment, etc. Really should be addressed by the Developer.

Only Show Comment in Wordpress

I am looking for a way to only show the comments posted in wordpress.
My main goal is to turn the wordpress CMS into a site like fmylife.com. The basic principle is allowing anyone to post anonymously (without having a post to comment on), and then the comments need to be moderated by the admin.
If there is an easier solution to doing this, then I'm open to hearing that as well. The only thing I don't want to do is get the fmyscript clone. I've tried that and don't like it.
Any advice would be appreciated.
Thanks.
Adam.
Why don't you try the buddypress plugin wherein users can register and post. Just disable all other components except activity feed and make your homepage as a static activity feed page (configurable in the settings).

Resources