
Tagged: Portfolio, taxonomy archive
-
AuthorPosts
-
February 13, 2025 at 2:36 pm #1477046
Hi!
I have a very destroyed looking archive page of a custom post type/taxonomy. No margins, huge images,…
Looking at the code there was “isotope” and “portfolio” all over the place instead of the regular grid display. After a while I thought about looking into the template-archives.php file of enfold since a change in Enfold 6.x was mentioned here in the forum.The strange thing is: there is hardcoded lots of “Portfolio” related stuff. Nothing is switched based on the post type, line 94 has hardcoded the posts query:
/* * Display the latest 20 portfolio posts */ query_posts( array( 'posts_per_page' => 8, 'post_type' => 'portfolio' ) );
It seems really off to me. It now absolutely makes sense now why deactivating the whole portfolio “feature” with the following code (found here in the forum) makes this archive page crash completely, too.
add_action('after_setup_theme', 'remove_portfolio'); function remove_portfolio() { remove_action('init', 'portfolio_register'); }
-
This topic was modified 2 weeks, 1 day ago by
48DESIGN.
February 13, 2025 at 2:53 pm #1477051As a quick workaround I redirect the template for taxonomy archives to the one for regular archives. But I think this should definitely be changed by Enfold!
/** * Use the regular archive template for taxonomy archives */ add_filter('template_include', function ($template) { if (is_tax()) { return locate_template('archive.php') ?: $template; } return $template; });
February 14, 2025 at 4:30 am #1477087Hi,
Thank you for the inquiry.
Did you register your own Portfolio post type? The theme includes this post type by default and uses the taxonomy-portfolio_entries.php file. Please provide a link to an archive page so we can check the issue.
Best regards,
IsmaelFebruary 14, 2025 at 8:41 am #1477107Hi,
link in the private content section.
I reverted my change mentioned above so you can take a look at the code but I have to enable this again soon!The thing is: yes, for “portfolio entries” there is a custom taxonomy template. But the general template for archives of all sorts template-archive.php has all the portfolio stuff baked in. This leads to the problem that every custom post type and custom post type category/taxonomy seems to use a template file that is not working correctly. And if one deactivates the portfolio post type completely there are errors that show problems with “portfolio” that is why I came across the workaround.
And no: we don’t add a custom “portfolio” post type but in this case a “downloads” CPT and an extra category/taxonomy “downloads-category”.
-
This reply was modified 2 weeks, 1 day ago by
48DESIGN.
February 15, 2025 at 1:20 pm #1477142I will re-enable my workaround to not hurt the client’s website…
You can directly look into the file I mentioned since it it normal Enfold code. In my opinion some portfolio related code shouldn’t be in this file since the archive template is not portfolio specific.February 17, 2025 at 1:42 am #1477215Hi,
Thank you for the update.
I will re-enable my workaround to not hurt the client’s website…
Please clone the site to a staging environment so we can see the actual issue. You can use plugins like Duplicator or WP Migrate DB to transfer the site to a different domain. Provide all additional info such as screenshots and any related links in the private field.
Best regards,
Ismael -
This topic was modified 2 weeks, 1 day ago by
-
AuthorPosts
- You must be logged in to reply to this topic.