sort even dont exists meta wordpress

The solution for “sort even dont exists meta wordpress” can be found here. The following code will assist you in solving the problem.

$query->set( ‘meta_query’, array(
‘relation’ => ‘OR’,
array(
‘key’ => ‘custom_meta_key’,
‘compare’ => ‘EXISTS’
),
array(
‘key’ => ‘custom_meta_key’,
‘compare’ => ‘NOT EXISTS’
)
) );
$query->set( ‘orderby’, ‘meta_value title’ );

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in