Hot answers tagged

2

Just few simple ideas: A) Here's one suggestion using the get_search_form filter with a static variable to handle the instance counting: add_filter( 'get_search_form', function( $form ) { static $instance = 0; $instance++; // Setup your form here with the $instance variable as needed: $form = '<form>...</form>'; return ...


1

The wp_get_attachment_image_src() function expects you to also pass some kind of attachment ID plus it doesn't grab the image HTML that we need so instead we should use wp_get_attachment_image(). IF a post has a post thumbnail, grab it.ELSE IF the post has any attached images, grab the first one.ELSE maybe show a placeholder? I've defined the else case at ...


1

Within the wp_get_document_title() function we have: // If it's a search, use a dynamic search results title. } elseif ( is_search() ) { /* translators: %s: search phrase */ $title['title'] = sprintf( __( 'Search Results for &#8220;%s&#8221;' ), get_search_query() ); so you could hook into the ...



Only top voted, non community-wiki answers of a minimum length are eligible