gchtr
Forum Replies Created
-
Forum: Plugins
In reply to: [Timber] Cannot be used without SSH accessIf you can’t install Composer on your shared host, this doesn’t mean that you can’t use Timber version 2.
You can use Composer locally on your computer and then upload the Composer dependencies to your shared host.
We have a guide where you can read all about how to switch from the plugin version to the Composer version of Timber: https://timber.github.io/docs/v1/getting-started/switch-to-composer/.
We recommend switching from the plugin version to the Composer version of Timber v1 first, and then do the upgrade to Timber v2.
Unfortunately, there will be no plugin version of Timber v2. You can read more about why in the announcement: https://github.com/timber/timber/discussions/2804.
Thanks a lot for fixing this!
Could you tell me if the?facetwp_refresh?is AJAX submission or regular POST data submission?
It’s an AJAX request made using
fetch()
withPOST
method:fetch(endpoint, { method: 'POST', // ... }
The endpoint can either be
- the current URL of the page that is displayed
- or a REST endpoint (e.g.
/wp-json/facetwp/v1/refresh
).
Here you can see an example from the FacetWP demo: https://facetwp.com/demo/cars/.
As far as I can see, no requests are made using admin-ajax.php.
@dearhive I understand that this could lead to problems with AJAX implementations. But not providing a solution is a reason for us to not use the DearFlip plugin at all. Performance is very important.
What if you added a setting where we can set how the assets are included? The setting could come with the following options:
- Load assets on every page load (optimal for AJAX implementations)
- Load assets only when the
dflip
shortcode is used
The way we work around this at the moment is to dequeue the assets and enqueue them only when the
dflip
shortcode is used. It works, but is not a future-proof method in case the included script or style names are updated.add_action( 'wp_enqueue_scripts', function() { wp_dequeue_script( 'dflip-script' ); wp_dequeue_style( 'dflip-icons-style' ); wp_dequeue_style( 'dflip-style' ); }, 11 ); add_filter( 'do_shortcode_tag', function( $output, $tag ) { if ( $tag !== 'dflip' ) { return $output; } wp_enqueue_script( 'dflip-script' ); wp_enqueue_style( 'dflip-icons-style' ); wp_enqueue_style( 'dflip-style' ); return $output; }, 10, 2 );
Forum: Plugins
In reply to: [Timber] PHP Fatal error after PHP upgradeWould you mind opening an issue for this in the Timber repository on GitHub?
We only rarely track issues here.
Hey @aclase. It would be best if you open a new issue in Timber’s GitHub repo, because we only rarely track issues here.
Forum: Plugins
In reply to: [Timber] Fatal Twig\Extension\DebugExtension Timber 1.21.0This should be fixed with Timber version 1.22.0.
Forum: Plugins
In reply to: [Timber] Issue with twig template and WP preview in new tabI see you posted your issue on GitHub: https://github.com/timber/timber/issues/2680.
This issue was resolved with version 1.22.0 of Timber. We updated the Twig version shipped with Timber and tested everything for PHP 8.0 and 8.1 support.
No need to create patches on your own ;).
Forum: Plugins
In reply to: [Timber] Display post content using two different single.twig filesHey @mikehermary
That’s very well possible with Timber and Twig.
But it’s not only a Timber and Twig use case. Your first hurdle is probably to set up a custom permalink structure for your use case, which is more directly related to WordPress itself rather than Timber and Twig.
You could use Routes, which might be easier to start with.
Since we only rarely answer questions here in the support forum, I suggest you post your question on StackOverflow using the Timber tag. You might get more exposure there.
Also, I would split your question into multiple smaller problems, because it would be a lot to expect of somebody to come up with complete code example for your use case.
Forum: Plugins
In reply to: [Timber] Ongoing PHP error kills the whole page.Hey!
That looks like somewhere in your theme
TimberHelper::function_wrapper()
is called. That function was deprecated and you shouldn’t use it anymore. Maybe you can search for “function_wrapper” in your theme to see where it is used.Refer to https://timber.github.io/docs/guides/functions/ for how to call functions in Twig.
I hope that helps.
Forum: Plugins
In reply to: [Timber] Unknown get_image function errorAlready answered in https://stackoverflow.com/a/65247276/1059980. I hope that helps.
That’s actually some kind of weird documentation bug that we’ll have to fix.
Forum: Plugins
In reply to: [Timber] Warning message from WPWhat’s your current version of Timber?
Thanks for reporting this. I created an issue in the repository.
Forum: Plugins
In reply to: [Timber] Language Switch as last item in menu inherits custom class namesI think this is a valid issue where Timber might be too restrictive with its check for a
WP_Post
object. Would you mind opening a new issue in Timber’s GitHub repository?Forum: Plugins
In reply to: [Timber] Wrong URL from URLHelper::file_system_to_urlWould you mind to create a new issue in the Github repository for this?