Viewing 7 posts - 31 through 37 (of 37 total)
  • Author
    Posts
  • #1002594

    Hi frankeee! “Cannot redeclare” – please check, if you have defined the function in two places or two files. And, in addition, I think that’s the moment for the support-team to have a look on your installation and on your files … Sorry!

    #1002613

    … Bernd – thank you so much for your support. Yes – hope the support team will have a look!

    #1003027

    Hi,

    You’ve two portfolio.php files in your child theme folder. Please delete the shortcodes/portfolio.php file and modify the shortcodes/portfolio/portfolio.php. This should fix the error.

    Best regards,
    Dude

    #1003031

    Hi Dude, the second portfolio.php was just for testing – anyway I delete it – but this will not fix the error. Still get this error:
    Fatal error: Call to undefined method avia_post_grid::use_search_and_filter_query() in /home/www/.../wp-content/themes/hana-reisen/search-filter/results.php on line 26

    • This reply was modified 6 years, 2 months ago by frankeee.
    #1003499

    Hi,

    I fixed it now. I replaced this code in portfolio.php:

    
    
    //postk puplic funktion for search and filter
    			public function use_search_and_filter_query($query)
    			{
    			   $this->entries = $query;
    			}
    

    with

    
    		//function that allows to set the query to an existing post query. usually only needed on pages that already did a query for the entries, like taxonomy archive pages.
    		//Shortcode uses the query_entries function above
    		public function use_global_query()
    		{
    			global $wp_query;
    			$this->entries = $wp_query;
    		}
    
    //postk puplic funktion for search and filter
    			public function use_search_and_filter_query($query)
    			{
    			   $this->entries = $query;
    			}
    

    and added this code to the child theme functions.php:

    
    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
    function avia_include_shortcode_template($paths){
    	$template_url = get_stylesheet_directory();
    	array_unshift($paths, $template_url.'/shortcodes/');
    	return $paths;
    }
    

    Best regards,
    Dude

    #1003680

    Hey Dude – it works – this is fantastic – thank you!!!

    Small note: “include-shortcode-filter” was already in my function. Your code has overwritten existing filters. But that doesn´t matter, I have a backup.

    Thanks again

    #1003685

    Hi,

    Great, glad it works now :)

    Best regards,
    Dude

Viewing 7 posts - 31 through 37 (of 37 total)
  • The topic ‘Portfolio entries’ is closed to new replies.