New answers tagged

5

Tell your boss that Visual Composer is the cancer of WordPress. Tell your boss that you've separated content concerns from visual ones, and that you're not tied into an abhorrent shortcode nightmare should you ever wish to move away from VC and/or change the layout. To elaborate, "VC vs ACF" isn't really a question - they are two completely different ...


0

I rewrote the function based on a few other posts I have seen online and now have the following code which works without any errors. I am still open to any further suggestions on the best way to streamline this code even further it it can be. Thanks again function downloads_shortcode($atts){ extract(shortcode_atts(array( 'download_type' => '' ), $...


0

Create a plugin for the mu-plugins directory and have your function run when the wpmu_new_blog action fires. Reference, here: https://codex.wordpress.org/Plugin_API/Action_Reference/wpmu_new_blog The hook you cited for ACF seems to be the way you ought to run you function, if you want that to happen upon ACF save...


0

This is not something that WordPress can easily do. You can think of pagination in WP as sliding window that shows fixed size part of one large query. It can be at start of the query or at the end, but it relies on it being same query. This doesn't nearly work when the size and number of the page are subject to variable logic like this. I had recently ...


2

You can use pathinfo() and getimagesize(): $info = pathinfo($image); if ( @getimagesize($info['dirname'] . '/' . $info['filename'] . '.' . $extension_to_check) ) { // do something }


0

if(get_sub_field('catalog_product_title')); ; is for ending a statement in php If you remove that ; your if statement should work.


1

When using ACF you should use the methods described in their website documentation because ACF does not store data in the normal Wordpress way. You can use the get_field or the_field functions to retrieve data from your fields. For example to get data for your field 'cover_photo' you could do: $user_id = get_query_var( 'author' ) $cover_photo = get_field('...


0

This is the finish code for this: <?php $dates_array = array(); $countries_array = array(); $term_list = array(); $current_term_list = array(); $args = array( 'post_type' => 'tours', 'posts_per_page' => -1 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); global $post; ...


0

if you are trying to link up the post in the user profile area, the code below might be a good starting point. You could put this in your functions.php file. The first function displays a select tag with all the posts from your custom post type in the user profile section. The option value is the post id, and the title is the post name. The next function ...


1

The type argument in your meta query is wrong. It spells NUMERICAL but the correct value is NUMERIC. $meta_query = array( array( 'key' => 'bpm', 'value' => array($bpm_start, $bpm_finish), 'type' => 'NUMERIC', 'compare' => 'BETWEEN' ) );



Top 50 recent answers are included