hello I am in need of guidance. sorry for the length of the message. This is my site http://lamiajoyee.com/wp/?page_id=147
if you click on the lands (the upper three in the corner), you will see a popup opens up with some pics and data.
these lands can be in two states, reserved and vacant. The difference is in the contents of the popup window. The page admin will set the status of the lands(vacant or reserved) in due time.
my problem is that i want to keep the status stored in a database and then check the status when the page is loaded/clicked. but the storage idea is not accurate. I have used 'contact form 7' and 'CFDB' with it. but there is a huge problem editing the data as you can only delete records using the free versions of CFDB or any other plugin as such.
Please suggest me a solution, I am not sleeping for the last three nights. Just store and check data. That's all
Use Advanced Custom Fields plugin - and add a custom field (true/false) for status.
Then in template file you could check: like this
if (get_field('house-status')) :
//your code that does something
else :
//your other code that does something else
endif;
Related
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.
I have a WordPress website and as part of the news items, the editor can add either an:
internal link OR
external link OR
file
Currently I have this set up as a repeater field with maximum rows set to 1.
Is it possible if say one value has been entered, to prevent another of the values from being filled in.
E.g. I add an internal link and then try to add an external link. A message of some sort is then shown to me to say that only one value can be selected at a time.
I know I can add a description to the field with this information but I want to make it idiot proof so that the user can never add more than one value.
Thanks for your time and help in advance.
I can't write this in comments but celeriko right. Install types plugin there is ability of conditional logic. You can very easy implement of from backend.
Types: http://wp-types.com/
Reagrds
If I need to manage a custom field under wordpress, but not from the admin area. In other words, I need that users modify the content of post custom fields from front end. What is the way to do so?
As instances, please to imagine Stackoverflow.com as a wordpress site. Under this site, the number of upvotes/downvotes and the accept state are my 2 post custom fields. How can I make the front end user modify their values in WP database?
Please If you have another better approach to create votes system and accept system, using wordpress, it will be highly appreciated. But if my approach (using post custom field) is okey, please to guide me find documentation from web or codex to achieve my goal.
Thank you for your usual help.
I would suggest thinking about a couple things:
Each post should show the sum of up-votes and down-votes
Each user should only be able to up or down-vote once (i.e., one user can't vote the same post up a hundred times)
You think you would want to create a function for your theme that allowed users when logged in to alter the metadata of a post. However, this isn't really the case – what you need to do is to allow users to edit an element of their own metadata (see add_user_meta) that is basically just a hash. The metadata could be like array("post-666-vote" => -1, "post-777-vote" => 1) for a downvote of post 666 and upvote of post 777.
So, when loading each post, your vote-tally-renderer would look something like this:
vote = get_post_meta($user_id, "post-" . $post_id . "-vote", true);
if(vote == -1) {
// Render down-arrow voting
} elsif(vote == 1) {
// Render up-arrow voting
} else {
// Render normal arrows
}
Each arrow would probably have to make an AJAX request to update the post's metadata. This is a long tutorial (but it's not super complicated! I promise!) and about 3/4 of the way down it talks about how to use an AJAX request to modify some user's metadata. http://wp.tutsplus.com/tutorials/plugins/a-primer-on-ajax-in-the-wordpress-frontend-actually-doing-it/
The only real major change is that the PHP function that is called by the WP AJAX request would also need a callback function to update the post's metadata, and change the number of votes on the post itself. This way, when the page is reloaded, it will show the proper number of votes.
I want my users to be able to mark posts as favorite. I tried the wp-favorite-posts plugin, but it doesn't work. I mark posts as favorites and after refreshing the page it's all gone. Furthermore, if I put {{wp-favorite-posts}} to a page, it just shows the text.
So I want to create my own solution, but don't really know how. I have never edited the WP database, but I have plenty of PHP mySQL experience.
Can anyone please point me in the right direction ?
You can use post_meta. You can store the "favourite" aspect as a custom field attached to each post. You don't need to manually edit the database (i.e. via mySQL).
When you want to show the favourited posts, run a custom query that only shows posts with the specific custom field that you've specified.
Im trying to add the avatar into my heartbeat stream, or any additional token for that matter and I dont seem to be able to get it working.
I've edited the default message template "User adds a node, save user activity". Here is what ive setup as the single message
!avatar !username has added !node_type !node_title. !mail
Then in rules ive setup the following variables:
#avatar=[author:heartbeat-user-picture]
#username=[author:user-name-url]
#node_type=[node:type-name]
#node_title=[node:title-link]
#mail=[author:mail]
#types=[node:type-name]
I then use display suite to theme my heartbeat streams. But instead of getting the Avatar to display or the Authors email address I get the actual tokens.
My messsage I get is as following:
!avatar ankh2054 has added the following journal: test and journal entry . !mail
Any help would be appreciated.
I looked further and I found the issue, but still a little puzzled of how I can fix it. The reason is not displaying the picture is because I am using a custom node & content profile for my user profiles & therefore have assigned a custome CCK field for the user avatar. Display suite seems to only pickup the default picture that is assigned via the built in Drupal profile.
Any ideas ? thanks for yuor help so far :)