WordPress.org

Forums

Genesis Custom Post Types Archives
Strange header output - help please (2 posts)

  1. Mickey Kay
    Member
    Posted 2 years ago #

    Hi there,

    Some weird behavior I just found - when searching for certain words using WP's builtin search widget, the search results page displays the gcpta_keywords for the first post in the results at random in the <head>. In my case, I did a search for "the" and the resulting page had a "grantee" custom post type as the first result. For some reason it looks like your plugin is outputting the keywords specified in the CPTs Archives settings page for this post type on the search results page, as well as on actual archive pages.

    I've traced back the issue as arising in the following function in the Custom Post Types Archives function:

    function gcpta_header_scripts() {
    	global $post;
    	echo apply_filters( 'gcpta_header_scripts' , genesis_get_option( 'gcpta_keywords_' . $post->post_type, 'gcpta-settings-' . $post->post_type ) );
    
    }

    Look like you might need some conditionals somewhere to prevent this from happening. Not sure where else this issue could arise, but might a simple if ( !is_search() ) suffice?

    http://wordpress.org/plugins/genesis-custom-post-types-archives/

  2. Mickey Kay
    Member
    Posted 2 years ago #

    PS - just to mention, I'm using the Types plugin for my custom post types - this might also be part of the problem.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Genesis Custom Post Types Archives
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic