[Resolved] Child theme

Home Forums Support [Resolved] Child theme

Home Forums Support Child theme

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #561936
    Catalin

    Hi,

    I’me using the child theme the first time because I would like to make a change in the functions.php file.
    Now, after changing my theme with your zip file my logo and the footer info are gone. I have no problem adding them back, but I hope this is the only issue I have.

    I wanted to add to the functions.php the following code:

    
    add_filter('pre_get_posts', 'query_post_type');
    function query_post_type($query) {
      if(is_category() || is_tag()) {
        $post_type = get_query_var('post_type');
    	if($post_type)
    	    $post_type = $post_type;
    	else
    	    $post_type = array('post','review');
        $query->set('post_type',$post_type);
    	return $query;
        }
    }

    in order to make also the categories and the tags searchable.

    Could somebody help me and let me know where exactly should I paste that code? I’ve tried it and the site crashes.

    Thanks.

    #562277
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I don’t believe that code will add those elements to the search.

    Have you considered using a plugin like this?: https://en-ca.wordpress.org/plugins/relevanssi/

    #562354
    Catalin

    Fantastic plugin. Thank you very much!

    #562565
    Tom
    Lead Developer
    Lead Developer

    No problem 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.