Customising the search function?

You can use pre_get_posts hoot to filter the search query to selected sectors only, something like this: function Search_with_in_a_tax( &$query ) { if ( is_search() && isset($_GET[‘sector_array’])) { $tax_query = array( array( ‘taxonomy’ => ‘news’, ‘terms’ => $_GET[‘sector_array’], ‘field’ => ‘term_id’, ) ); //turn it into a WP_Tax_Query object $tax_query = new WP_Tax_Query($tax_query); $query->set(“tax_query”, $tax_query); … Read more

How to make number of blog posts a custom field?

It might actually still work, but the syntax is currently wrong (you have a PHP opening tag inside another opening tag). And you can assign the value of the custom field to a variable using the get_field function. What if you try this? <?php // assuming your ACF name is ‘number_of_posts’ $numposts = get_field(‘number_of_posts’); $args … Read more

Plugins Page invisible / white

The Bug …is well known, but it’s not a bug. It’s an Error, that you don’t display. The Fix Move into your ~/wp-config.php file. Then add define( ‘WP_DEBUG’, true ); and read your Error message.

Mass update excerpt

Issue 1: creating the excerpt data This should be fairly easy to do directly with SQL. UPDATE wp_posts AS post INNER JOIN wp_posts AS attachment ON attachment.post_type=”attachment” AND post.ID = attachment.post_parent SET post.post_excerpt = CONCAT(‘<img src=”‘, attachment.guid,'” />’) WHERE post.post_excerpt=””; This is obviously a “one-time fix” that implies you have access to the database. If … Read more