Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter RiaanC

    (@riaanc)

    No sorry. I have not tested that.

    Thread Starter RiaanC

    (@riaanc)

    Hi. No I did not. Currently I have to manually set the expiry date so it is not truly automated.

    If you use the default WP registration form it works just fine.

    Thread Starter RiaanC

    (@riaanc)

    Hi Jonathan

    Thank you for the quick response. Pity about that, but understandable.

    Thank you for pointing me in the right direction with the custom query. I will give it a go.

    Riaan

    RiaanC

    (@riaanc)

    Nice one Johnathan!

    The code I have posted is a overriding WP function and will force all queries to sort that way, if they have the rating value. Not very flexible.

    This way we have control. Good work. I will definitely be using this functionality.

    Riaan

    Thread Starter RiaanC

    (@riaanc)

    Aha! And it works perfectly.

    Thank you Jonathan.

    Riaan

    Thread Starter RiaanC

    (@riaanc)

    Fantastic! Thank you for the quick change.

    I did the upgrade, but the “silent” meta values are no longer available, so I cannot show the price. I then went back and thought I had to do the quick fix as per your first reply, but the code isn’t the same anymore. I guess that is the change you made to expose those values, but I don’t see them.

    Riaan

    Thread Starter RiaanC

    (@riaanc)

    No problem. I am glad to share and help others use your great plugin.

    I do have one last question. I am rewriting the _sale_price field to include the currency symbol – R{{meta__sale_price}}. Works great, but it displays the currency symbol on the page irrespective whether a _sale_price exist or not. So for products with a sale price the symbol displays and also for those without.

    I will eventually figure out the PHP if statement to exclude the symbol if the _sale_prices doesn’t exist, but if you have another solution or that functionality already built in, I would be very grateful.

    Riaan

    Thread Starter RiaanC

    (@riaanc)

    Hi Jonathan

    You are the man! Thank you so much for the quick reply. Works perfectly!

    I have used your plugin on many sites now and it is of huge value to me and my clients. This in combination with Advanced Custom Fields is a winning combination.

    Thank you for one of the best plugins ever!

    Regards
    Riaan

    RiaanC

    (@riaanc)

    Add this to your functions.php

    // Custom sort by rating
    function my_custom_sort( $query ) {
    
        if ( $query->is_archive())
        {
        	$query->set('meta_key', 'rating');
    		$query->set('orderby', 'meta_value_num');
        	$query->set('order', 'ASC');
        }
    	return $query;
    }
    add_action('pre_get_posts', 'my_custom_sort');

    RiaanC

    (@riaanc)

    Hi

    I see you have not received an answer although the post is 3 months old. I wrestled with this for a long time too. Do this…..

    In your Query Wrangler add the field like ‘start_date’ you want to return and exclude it from the display. Create a callback field called ‘my_custom_date’ – tick the box “include additional information”.

    Then in your functions.php add:

    /* Change the date format of ACF ‘start_date’ */
    function my_custom_date($post, $field, $tokens){
    $date = DateTime::createFromFormat(‘Ymd’, ($tokens[‘{{meta_start_date}}’])); echo $date->format(‘F d, Y’);
    }

    You can format the date to your linking in the echo.

Viewing 10 replies - 1 through 10 (of 10 total)