-
AuthorPosts
-
August 28, 2018 at 8:55 am #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!
August 28, 2018 at 9:58 am #1002613… Bernd – thank you so much for your support. Yes – hope the support team will have a look!
August 29, 2018 at 8:37 am #1003027Hi,
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,
DudeAugust 29, 2018 at 8:47 am #1003031Hi 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.
August 30, 2018 at 12:01 pm #1003499Hi,
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,
DudeAugust 30, 2018 at 3:29 pm #1003680Hey 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
August 30, 2018 at 3:45 pm #1003685Hi,
Great, glad it works now :)
Best regards,
Dude -
AuthorPosts
- The topic ‘Portfolio entries’ is closed to new replies.