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

Get search.php results in header.php?

Now, is it possible to check if page is the search page is_search() AND what’s the search string is_search() AND print get_query_var( ‘s’ ) AND how many posts were found? is_search() AND print $GLOBALS[‘wp_query’]->number_posts() … or if you got a custom query… $my_query = new WP_Query( array( /* whatever args */ ) ); is_search() AND … Read more