Reply To: Read More Label in Search Result Page

Home Forums Support Read More Label in Search Result Page Reply To: Read More Label in Search Result Page

#211734
Markus

Hi Tom,

not all of results are pages, some are posts (if they show a date),
as seen in the search example.
In the last example above (tag page) , all are pages. If I add some posts, nothing changes.

~~~

I checked the https://wordpress.org/plugins/tag-pages/

Because it contains just two functions, I added those to my child theme’s function.php.

/**
 * Add the 'post_tag' taxonomy, which is the name of the existing taxonomy
 * used for tags to the Post type page. Normally in WordPress Pages cannot
 * be tagged, but this let's WordPress treat Pages just like Posts
 * and enables the tags metabox so you can add tags to a Page.
 * NB: This uses the register_taxonomy_for_object_type() function which is only
 * in WordPress 3 and higher!
 */
if( ! function_exists('tagpages_register_taxonomy') ){
    function tagpages_register_taxonomy()
    {
        register_taxonomy_for_object_type('post_tag', 'page');
    }
    add_action('admin_init', 'tagpages_register_taxonomy');
}

/**
 * Display all post_types on the tags archive page. This forces WordPress to
 * show tagged Pages together with tagged Posts. Thanks to Page Tagger by
 * Ramesh Nair: http://wordpress.org/extend/plugins/page-tagger/
 */
if( ! function_exists('tagpages_display_tagged_pages_archive') ){
    function tagpages_display_tagged_pages_archive(&$query)
    {
        if ( !is_admin() && $query->is_archive && $query->is_tag ) {
            $q = &$query->query_vars;
            $q['post_type'] = 'any';
        }
    }
    add_action('pre_get_posts', 'tagpages_display_tagged_pages_archive');
}
?>