• Are there plans to allow Featured products, hopefully from a specific category in the query?

    Or is there a way to add that in on my end?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Code Amp

    (@codeamp)

    Hey @coldrealms65

    Do you want make a query that only shows featured products?

    I haven’t tried this before, but (if you are happy with some PHP coding) it might be possible.

    The logic would be:

    1. Edit the query using our query_args filter here:
    https://customlayouts.com/documentation/action-filter-reference/

    function layout_query_args( $query_args ) {
    	// Add the code from SE here:
    	// $query_args['tax_query'] = ...
    
    	return $query_args;
    }
    
    add_filter( 'custom-layouts/layout/query_args', 'layout_query_args', 10 );

    2. Apply the logic from this SE answer:
    https://stackoverflow.com/a/46247028/459359

    I think the only part you would need is the tax_query part. So you would add the tax_query to:

    $query_args['tax_query'] in step (1) above.

    I hope that will work for you!

    Best

    Thread Starter coldrealms65

    (@coldrealms65)

    Might be a bit above my coding ability but i’m always willing to give it a whack!

    Just build the above function and slap it in a php file from something like “Woody’s Snippets”?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Featured Product?’ is closed to new replies.