YMC-22 / smart-filter

YMC Smart Filter, allows to solve a variety of tasks for displaying posts on site pages. For advanced developers, there is an opportunity to independently develop layouts for filters and post cards, which makes the plugin universal.
14 stars 6 forks source link

Problem lost custom template when update #10

Closed jorge-teixeira closed 8 months ago

jorge-teixeira commented 8 months ago

First of all, thank you very much for the excellent work. The plugin is fantastic ! I’m trying to implement it on a website, but with the latest update, I lost all the changes made in the file post-custom-layout.php. I might be mistaken, but I thought we could create our own custom templates there. If I’m wrong, I apologize. I would like to know how we can create new templates, especially for pagination and post filtering. Having that option would be interesting. πŸŒŸπŸ™Œ

YMC-22 commented 8 months ago

Hi! Firstly, to create custom layouts (templates), you need to select the Custom templates option in the plugin settings. Then, using hooks - add_filter('ymc_post_custom_layout_545_1', 'my_custom_post_layout', 10, 5); You should describe the structure of the post template in your topic. Examples are in the documentation https://github.com/YMC-22/smart-filter. It’s not entirely clear how you previously created the template that it was overwritten after the update. There is no need to make changes in the plugin itself (file post-custom-layout.php) as it is constantly updated. All edits should be made only through plugin hooks.

jorge-teixeira commented 8 months ago

First of all, thank you for the quick response. And yes, I selected both the filter layout: custom filter layout and the select post layout: Custom Layout, just like in the example. Within these files, I made changes, added divs, and classes according to what I wanted to achieve. For instance:'$layout = '<h1 class="custom_div">'.get_the_title($post_id).'</h1>';and so on. I apologize if I’m saying anything incorrect; I’m new to the world of programming and might have misunderstood the documentation. πŸ™ŒπŸ€“

YMC-22 commented 8 months ago

Please send us your layout code, as well as a link to the page on your website where your filter is located. we can analyze and provide you with a solution to your task.

YMC-22 commented 8 months ago

Please contact us with any questions.