Do not uses global search if Tainacan plugin is not installed.
This commit is contained in:
parent
18c1c42de4
commit
16709683ae
|
@ -192,7 +192,7 @@ add_action( 'admin_head', 'tainacan_customize_editor_css');
|
|||
*/
|
||||
function tainacan_include_items_in_search_results( $query ) {
|
||||
|
||||
if ( $query->get( 'post_type' ) !== 'tainacan-collection' && !$_GET['onlyposts'] && !$_GET['onlypages'] && $query->is_main_query() && $query->is_search() && ! is_admin()) {
|
||||
if ( defined ('TAINACAN_VERSION') && $query->get( 'post_type' ) !== 'tainacan-collection' && !$_GET['onlyposts'] && !$_GET['onlypages'] && $query->is_main_query() && $query->is_search() && ! is_admin()) {
|
||||
$collections_post_types = \Tainacan\Repositories\Repository::get_collections_db_identifiers();
|
||||
$existing_post_types = $query->get( 'post_type' );
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
if ( !$_GET['onlyposts'] && !$_GET['onlypages'] && is_search() ) {
|
||||
if ( defined ('TAINACAN_VERSION') && !$_GET['onlyposts'] && !$_GET['onlypages'] && is_search() ) {
|
||||
$post_type = get_post_type();
|
||||
$post_type_object = get_post_type_object($post_type);
|
||||
$post_type_label = $post_type_object->labels->singular_name;
|
||||
|
@ -15,7 +15,7 @@
|
|||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="col-xs-12 blog-content <?php if ( has_post_thumbnail() ) :?>col-md-8 blog-flex<?php else : ?>col-md-12<?php endif; ?> align-self-center">
|
||||
<?php if ( !$_GET['onlyposts'] && !$_GET['onlypages'] && is_search() ) : ?>
|
||||
<?php if ( defined ('TAINACAN_VERSION') && !$_GET['onlyposts'] && !$_GET['onlypages'] && is_search() ) : ?>
|
||||
<div class="title-area">
|
||||
<h3 class="mb-3">
|
||||
<a href="<?php the_permalink(); ?>" class="font-weight-bold"><?php the_title(); ?></a>
|
||||
|
|
Loading…
Reference in New Issue