custom-fields

List custom post type by custom field date

一笑奈何 提交于 2019-12-04 17:11:59
I'm working with Wordpress and WP-Types plugin and need to sort CPT by a custom field date. This work fine: $args = array( 'post_type' => 'parties', 'paged' => $paged, 'meta_key' => 'wpcf-parties_date', 'orderby' => 'meta_value', 'order' => 'DESC', ); The orderby works perfect. On the Database the value of the field date 'wpcf-parties_date' is store in this way ex: 1349481600 . I have two templates where i need to show past and upcoming Posts. My question is how can i display only the future or past posts regarding the current date? I try this with no luck. $args = array( 'post_type' =>

Orderby ACF custom field date don't work

为君一笑 提交于 2019-12-04 05:20:02
问题 I view the other post but I found nothing, I'm on since 3 days : I want display 3 'evenements' in the order ASC but 2018 is always before 2017 $auj = date('Ymd'); $queryEvent = new WP_Query( array( 'category_name' => 'evenements', 'posts_per_page' => 3, 'meta_key' => 'date_de_fin', 'orberby' => 'meta_key', 'order' => 'ASC', 'meta_query' => array( array( 'key' => 'date_de_fin', 'value' => $auj, 'compare' => '>=', ), ) ) ); ?> someone has an idea ? 回答1: I have updated your code .Please try your

Android contacts custom field

半城伤御伤魂 提交于 2019-12-04 04:42:58
问题 Is it possible to add custom field to some contacts, with custom mimetype (like facebook profile) without writing sync adapter, authenticator and sync service? I do not want to add "synchronization" functionality for my application. 回答1: After long research I think that I found an answer to this question. There is no way of creating custom clickable and visible fields without writing some Synchronization service code, authenticator and syncAdapter. Here is sample code which is adding new

Add a custom field in Woocommerce Edit Account page

自闭症网瘾萝莉.ら 提交于 2019-12-03 21:41:05
I have custom checkout fields favorite_color that users can fill in during checkout (not required) ,imilar to other default checkout fields... In My Account section in "Edit Account", I Would like to add favorite_color custom field to allow customer editing this field value. For that I have edited the template myaccount/form-edit-account.php by copying and editing an original line of code in it: <p class="woocommerce-form-row woocommerce-form-row--first form-row form-row-first"> <label for="account_first_name"><?php _e( 'First name', 'woocommerce' ); ?> <span class="required">*</span></label>

Add custom fields as cart item meta and order item meta in WooCommerce

夙愿已清 提交于 2019-12-03 20:31:31
问题 This is a plugin on how to add add cart item meta & order item meta for my WooCommerce order. Initially my code below worked well for input type=text. It returns the label for value and the inputed value. On conversion to type=checkbox the code returns label and value="on" for those that are checked. I would like to return the only value names of checked values (ignore the values unchecked). A refactor to help include more checkboxes options would be helpful to reduce written code. My code: <

Add custom field data to WooCommerce order

只愿长相守 提交于 2019-12-03 14:46:46
问题 I have a custom field on my WooCommerce single product. It sends to the cart fine, it displays on checkout fine, it shows in the order in the dashboard fine. What I am now trying to do is set the value as a custom field in the order page so I am able to amend the text when I need to. For some reason when I submit the form this step isn't working. The code that i use in my functions.php file: // Add the field to the product add_action('woocommerce_before_add_to_cart_button', 'my_custom

click count of a certain link in wordpress post

女生的网名这么多〃 提交于 2019-12-03 13:41:00
问题 Is it possible to count how many times a certain link in post has been clicked? (for example purpose, let's say that the certain link has an ID named 'bla') <a id="bla" href="#">download</a> I got a feeling it should be possible by using custom-fields/post-meta (to keep the count), just like the ever-so-popular 'visitor count' trick. Unfortunately, I'm rather clueless about PHP s. 回答1: It could be done with ajax call that updates post meta field before the link is followed. Example below

WooCommerce REST API Custom Fields

萝らか妹 提交于 2019-12-03 12:19:36
Is it possible to access custom fields for orders, products, customers via WooCommerce REST API? If not natively, then what plugins or workarounds or hacks are out there that work? Thanks! Answering my own question: It is possible using the following: (using v3 legacy API) To send custom fields back to the server: (For Orders) { "order_meta": { "key": "value" } } To retrieve custom fields from server use this filter with your end point: http://www.example.com/wc-api/v3/orders?filter[meta]=true This works for Products as well. As mentioned in the comment after WooCommerce creates an order via

click count of a certain link in wordpress post

那年仲夏 提交于 2019-12-03 04:37:43
Is it possible to count how many times a certain link in post has been clicked? (for example purpose, let's say that the certain link has an ID named 'bla') <a id="bla" href="#">download</a> I got a feeling it should be possible by using custom-fields/post-meta (to keep the count), just like the ever-so-popular 'visitor count' trick. Unfortunately, I'm rather clueless about PHP s. It could be done with ajax call that updates post meta field before the link is followed. Example below registers ajax action for users that are not logged in, and increases link_click_counter custom field by 1 on

WORDPRESS: Is Custom Fields the solution for my portfolio?

随声附和 提交于 2019-12-02 21:09:02
问题 Here's a brief explanation of what I'm trying to do: My homepage will have about 12 thumbnail images with title, short description, maybe web url (arranged 3 x 4 or whatever). I want each of these entries to link to my single.php page which will show more details about each project, with multiple larger image files that will display with captions to the right of the project description. I'm thinking the best way to approach this would be to use the 'featured image' for the thumbnail display