Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Show custom post types in search results in page #895225

    Hi Ismael,
    thank you for your reply. Yes, I have already taxonomy for it called “portfolio_category ” and it works. All changes to functionality is done via my own plugin. I added several post types, shortcodes etc. and it all works.
    Now I have found a solution. I had to add a script to my plugin that enables search within defined post types:

    add_filter( 'pre_get_posts', 'jetel_search' );
    function jetel_search( $query ) {
    	if ( $query->is_search ) {
    		$query->set( 'post_type', array( 'post', 'page', 'kurz', 'lektor', 'portfolio' ) );
    	}
    	return $query;
    	}

    I have another question. How to limit a number of results in each category in instant search. Mean 3 results for pages, 3 for posts, 3 for courses…
    And how to display similarly sorted results in page?

    • This reply was modified 6 years, 10 months ago by jetel.

    Dear Andy,
    isn’t it clear from my description? It is Polylang, latest version. It works fine when no category selected but when one or more are present than it goes wrong. I suppose there must be a different query for showing portfolio from a particular category/ies than it is for unsorted posts. Otherwise it would work.
    Best regards

    So there is a progress in my instalation. It worked until I created new page! It allowed one edit and now it is broken as well (sorry for not testing my previous solution deeply).

    Otherwise I tried mrjukic solution and worked for me. Just open wp-config.php in your wordpress installation folder and add folowing row:

    define( 'CONCATENATE_SCRIPTS', false );

    Now the editor is finaly working as expected (no deep testing, just tried a little). Thanks mrjukic for advice!

Viewing 3 posts - 1 through 3 (of 3 total)