Footer and Layout Issues – Non Search Pages
-
For starters, I like this plug-in.
I’m using Genesis 2.2.0 and found some code on https://www.relevanssi.com/knowledge-base/relevanssi-and-genesis/, which I added to functions.php. (I did remove a section on WooCommerce as I don’t use it.)
Those 2 snippets gave me what I wanted for search results – excerpts and featured image. It nicely pulls in my custom post types I created using Types and Views.
However, the second snippet below creates problems on custom post types. The layout is broken and content is missing. The footer is also missing from all pages, even if not a CPT.
I’ve searched here and the Relevansi site, but not sure where to go next. If I pull the 2nd snippet, the correct layout returns but I no longer have the excerpts and featured image.
Thanks in advance.
// Modify content to add Featured Images and Relevanssi permalink remove_all_actions( 'genesis_entry_content' ); add_action( 'genesis_entry_content', 'child_do_post_excerpt' ); function child_do_post_excerpt() { // Get featured image if page or post the_post_thumbnail( 'medium', array( 'class' => 'alignright' ) ); // Get excerpt rather than the_content() so Relevanssi can grab a snippet and highlight search terms the_excerpt(); // Get 'Read More' link with Relevanssi permalink if ( function_exists( 'relevanssi_get_permalink' ) ) { echo '<a class="read-more-link" href="' . esc_url( relevanssi_get_permalink() ) . '">View more ?</a>'; } }
- The topic ‘Footer and Layout Issues – Non Search Pages’ is closed to new replies.