Sort wp_query by sum of two meta fields
Sort wp_query by sum of two meta fields
Sort wp_query by sum of two meta fields
This should do it, using pre_get_posts: function wpse_275546_hide_distribution_post( $query ) { /* Don’t filter posts in admin, or the current post when viewing a single post. */ if ( ! is_admin() && ! ( $query->is_main_query() && is_single() ) ) { /** * Get current meta query if it exists, otherwise an empty array. * This … Read more
Is there a way to notify specific users when new posts are published to specific pages?
Order Custom Post Type by Custom Field Value
Since you are using get_sub_field() i assume you are inside a have_rows() (a repeater), in theory it should work like this: $image = get_sub_field(‘image’); <img src=”https://wordpress.stackexchange.com/questions/278286/<?php echo $image[“url’]; ?>” alt=”https://wordpress.stackexchange.com/questions/278286/<?php echo $image[“alt’] ?>” /> and this is what you can get: $image[‘url’] //this is the full image echo $image[‘sizes’][‘medium’]; //medium image echo $image[‘sizes’][‘thumbnail’]; //thumbnail image … Read more
Custom Fields for Custom Post [closed]
So I’m not really sure exactly what you mean by adding a custom field value via the native image uploader. I would need better explanation to help troubleshoot that. However, I’ve done something similar using Advanced Custom Fields to do what you’re ultimately trying to achieve. What I did was create an ACF field group … Read more
You could go with a plugin or just a theme options page that I believe is a better approach as you build a theme. You could find more information about theme options page to the wordpress CODEX and the Customize API You could use something like this add_settings_section( string $id, string $title, callable $callback, string … Read more
Add custom field in comments form
Manipulate javascript code from custom made admin page menu