flyntwp / flynt Goto Github PK
View Code? Open in Web Editor NEWComponent based WordPress starter theme, powered by ACF Pro and Timber, optimized for a11y and fast page load results.
Home Page: https://flyntwp.com
License: MIT License
Component based WordPress starter theme, powered by ACF Pro and Timber, optimized for a11y and fast page load results.
Home Page: https://flyntwp.com
License: MIT License
Hi again
it works fine so far, but on pages / posts i get a compilation error:
preg_match(): Compilation failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 5 in D:\laragon\www\XXX\wp-includes\class-wp.php on line 222
And yes, its Windows :)
This is a very intriguing starter. Based on a first look, webcomponents and ACF appear to be a rhyming couplet. Do you have performance metrics?
When embedding vimeo
videos, a warning message appears:
Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity, line: 1 in /web/app/themes/.../lib/Utils/Oembed.php on line 24
It can be suppressed by prepending the line with an @
symbol:
@$Dom->loadHTML($iframeTagHtml);
I'm using LARAGON to development in PHP. Laragon use APACHE to serve local sites.
There is an issue to load images. They returns 404 error.
How to fix it?
I am using a clean install of the theme to test with, on a clean install of WP. I have made no changes whatsoever other than configuring the host URL. Using any component that has images, none of the images have a set height, so they do not appear.
I regenerated the thumbnails to be sure, but that nad no effect. The above images are inspecting the Block: Image Text
component, but this issue occurs so far in all components that can use an image.
What is the minimum PHP version?
Please add it to composer.json.
Thanks.
Hello,
I am familiarizing with the framework and really like what you have achieved, thanks for sharing with the community!
I was planning to use it as a core-framework for multiple websites, thus creating a local composer package that I'd pull into each site, that would bring common Components (especially admin ones), the logic (most of the /lib files and /inc files) and admin assets.
Website specific content/settings would need to be outside of the core framework:
Have you considered at one point doing this kind of setup?
I stumbled upon stoutlogic ACF builder which seems to do the same as your acf-field-group-composer but in a less verbose way, is there any major features missing in ACF builder that would prevent the switch?
Do you plan to introduce simple unit tests?
Codeception is a very good platform: https://github.com/lucatume/wp-browser
Is the main navigation supposed to support drop down menus? It looks like the footer nav has a sub-menu with {% if item.get_children and level + 1 <= maxLevel %} but it doesn't work.
I tried to use the timber nav walker but couldn't get the css to work using level-1 and level 2. It appears that the css is missing for level-0.
Any help would be appreciated.
Dave
Hi, I'm tying to install Flynt on my wordpress on localhost. I'm having troubles with composer install:
***-MBP:flynt-1.1.1 ***$ composer install
-bash: composer: command not found
Can please someone help me with this?
I'm running Flynt with the latest WordPress release on an AWS Lightsail Instance. WordPress dashboard suggested that my PHP version should be updated to 7.4, and so I tried to update my server's PHP version to 7.4 through the command line. I must have done something wrong, since the command "php -v" still shows an older version and my server homepage shows the default Apache2 page, not WordPress. I'm at a loss here and wondered if this is a conflicting issue within Flynt or if I just did something completely wrong that broke WordPress. Any help would be greatly appreciated. Thanks.
When I go through the install process and then activate the theme I get the following error in the browser: Warning: require_once(/var/www/html/wp-content/themes/flynt-1.1.1/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/wp-content/themes/flynt-1.1.1/functions.php on line 7
I feel like I have missed a step but I'm not sure what?
Hello team Flynt (and Bleech)!
I normally create an editor-style.css so I can customise the css within the TinyMce editor. And since the theme is using SASS, it makes sense to try and utilise the SASS process to generate this stylesheet, so it can inherit styles.
This is how I achieved it - is this a good method, or would you guys have achieved this in a more optimal way?
In an ideal world I wouldn't want to be editing the build-config.js, but I didn't see any other way?
/build-config.js
webpack: {
entry: {
"assets/main": "./assets/main.js",
"assets/admin": "./assets/admin.js",
"assets/editor-style": "./assets/editor-style.js",
},
copy: [getCopyConfig("./Components/**/*"), getCopyConfig("./assets/**/*")],
},
/inc/tinyMce.php
// Editor Styles
add_editor_style('dist/assets/editor-style.css');
/assets/editor-style.js
import "./scripts/publicPath";
import "./editor-style.scss";
function importAll(r) {
r.keys().forEach(r);
}
importAll(require.context("../Components/", true, /\/editor-style\.js$/));
/assets/editor-style.scss
@import "styles/variables";
@import "styles/mixins";
@import "styles/base";
etc.
Cheers,
Tim
p.s. I'm loving the new theme release v1+. So thank you for that!
It's a huge improvement over the beta version, and already feels a lot faster to use : )
Overview of the Issue:
SCSS partials are currently imported using absolute paths. For example in main.scss
file:
@import '../node_modules/easings-css/easings';
Motivation or Use Case:
Import code is longer than needed and prone to typographical errors. Any future change in folder/path structure might introduce errors as all the instances of the path need to be manually updated.
Suggest a Fix:
This can be fixed, buy adding node_modules
path in the webpack.config.js
file at line #71
, like so:
includePaths: ['node_modules'],
SCSS partial files can be then referenced using the relative paths, like so:
@import 'easings-css/easings';
Is there documentation on accessing the Gutenberg editor?
Is there a way to restore the default wordpress editor when editing a post?
Hi, how can I activate the minification of the css and js files?
Thanks
Hello,
After adding slider componet when I tried to save page I got this warning.
Warning: in_array() expects parameter 2 to be array, string given in flynt-1.1.0\inc\theContentFix.php on line 24
Lines 19 to 24 in 325e667
Shouldn't be it like
if (in_array($postArr['post_type'], [ 'revision', 'nav_menu_item', 'attachment', 'customize_changeset' ])) {
Regards
Timber is a fine software - 2.x is coming soon
ACF is a poorly written one-man-show for non-tech-savvy people thus is not sustainable.
How cloud they marry?
Hello
add_filter('Flynt/addComponentData?name=SiteHeader', function ($data) {
$data['header_menu'] = new Timber\Menu('header_menu');
$data['logo'] = [
'src' => Asset::requireUrl('Components/SiteHeader/Assets/logo.png'),
'alt' => get_bloginfo('name')
];
return $data;
});
{% for item in header_menu.items %}
<li class="{{ item.classes | join(' ') }}">
<a href="{{ item.link }}">{{ item.title }}</a>
{% if item.children %}
<ul class="submenu">
{% for child in item.children %}
<li class="{{ child.classes | join(' ') }}">
<a href="{{ child.link }}">{{ child.title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
for navigation, I used the above code.
and I want two languages for English and Portugues.
but when I set Menu language switcher on WPML, only the current language(English) item is added to the header menu.
How can I fix that issue?
Regards
Love this framework, it would be great it had support for custom_logo
aswell.
Hello,
I'm having trouble creating an ajax action with:
function test_callback() {
echo 'test';
}
add_action ('wp_ajax_test', 'test_callback');
add_action ('wp_ajax_nopriv_test' ',' test_callback ');
If I insert the declaration on the function.php file of the component, wordpress does not see it.
If instead I insert the declaration on the file inc/theme.php then it works correctly.
Hello,
I'm developing a website using Flynt and have really enjoyed is so far. I'm curious if there's an good way to pre-populate specific components on and page with the same template, just like is available with standard ACF. I have tried to find a solution by digging around in the code, but haven't come up with anything. If this is possible and someone could explain it to me I would really appreciate it.
Thanks
Adding @phpstan to CI is like adding 100 pairs of eyes.
composer require --dev szepeviktor/phpstan-wordpress php-stubs/acf-pro-stubs
phpstan.neon.dist
includes:
- vendor/szepeviktor/phpstan-wordpress/extension.neon
parameters:
level: max
inferPrivatePropertyTypeFromConstructor: true
dynamicConstantNames:
- WP_ENV
paths:
- lib/
- inc/
autoload_files:
- vendor/paulthewalton/acf-pro-stubs/acf-pro-stubs.php
- vendor/twig/twig/src/Extension/CoreExtension.php
- inc/timberLoader.php
# Includes
- inc/baseStyle.php
- inc/componentLogServer.php
- inc/fieldVariables.php
- inc/options.php
- inc/theContentFix.php
- inc/tinyMce.php
- inc/yoastToBottom.php
- inc/youtubeNoCookieEmbed.php
# Components
- Components/BlockCollapse/functions.php
#- Components/BlockCookieNotice/functions.php
- Components/BlockImage/functions.php
- Components/BlockImageText/functions.php
#- Components/BlockNotFound/functions.php
#- Components/BlockPostHeader/functions.php
- Components/BlockVideoOembed/functions.php
- Components/BlockWysiwyg/functions.php
- Components/FeatureAdminComponentScreenshots/functions.php
#- Components/FeatureGoogleAnalytics/functions.php
- Components/FormPasswordProtection/functions.php
- Components/GridImageText/functions.php
#- Components/GridPostsArchive/functions.php
- Components/GridPostsLatest/functions.php
- Components/ListComponents/functions.php
#- Components/ListSearchResults/functions.php
#- Components/NavigationBurger/functions.php
#- Components/NavigationFooter/functions.php
#- Components/NavigationMain/functions.php
- Components/SliderImages/functions.php
ignoreErrors:
# Uses func_get_args()
- '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#'
then run vendor/bin/phpstan analyze -l 4
Please consider reading https://www.php-fig.org/psr/psr-1/#23-side-effects
...which implies loading Components with PSR-4 (aka. Composer loader) and being implemented as classes.
Hello,
i made a fresh install with the latest node (13.12.0) and when i run npm run build i get for every php file an error:
Example:
1 | ERROR | [x] End of line character is invalid; expected "\n" but
| | found "\r\n"
| | (Generic.Files.LineEndings.InvalidEOLChar)
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
Along with
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: run-s --silent checkVersion clean lint build:production build:rev
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Hi, I don't do much Wordpress, and just wanted to ask if child theme is supported with Flynt...and if so, what do I have to do to get it up and running?
Thanks
Hi team Flynt!
I have a question about the Field Groups - is it possible to have a 'default' component added to a newly created page in the admin?
For example, with the code below, I'm currently only registering 1 component in this particular field group, so when the client creates a new page (or taxonomy as this would be), it would be handy if this component was added to the page by default.
Any thoughts or tips would be much appreciated!
Cheers,
Tim
<?php
use ACFComposer\ACFComposer;
use Flynt\Components;
add_action('Flynt/afterRegisterComponents', function () {
ACFComposer::registerFieldGroup([
'name' => 'moduleComponents',
'title' => 'Module Components',
'style' => 'seamless',
'fields' => [
[
'name' => 'moduleComponents',
'label' => __('Module Components', 'flynt'),
'type' => 'flexible_content',
'button_label' => __('Add Component', 'flynt'),
'layouts' => [Components\TopicTemplate1\getACFLayout()],
],
],
'location' => [
[
[
'param' => 'taxonomy',
'operator' => '==',
'value' => 'module',
],
],
],
]);
});
I would like to use flynt as a framework, but build my own components. On a fresh install of the flynt starter theme, things work great. However, if I delete all the default components from the components directory, the theme breaks completely. I can only get a 500 response when I try to access either the frontend or the admin dashboard that says, "The site is experiencing technical difficulties."
I was expecting/hoping that I could use flynt but with my own components and not the built in flynt ones, is this supposed to be possible or is it impossible by design? If not, are all the default components required or is there a minimum requirement? I would like to remove as many unused things as I can.
Flynt is very good. but now the Gutenberg is disabled for WordPress default post type? I would like to use the Gutenberg only for Wordpress default post type, so not use ACF flexible content like now. how can I do this?
Eveytime i upload img or any other asset and i try to use it in page components ive got 404 (Not Found) - because flynt Theme is adding word dynamic into url
for example
https://test.local/wp-content/uploads/dynamic/2020/01/P1040406_DxO-1440x0-c-default.jpg
I think it's better to restrict access to .twig files in the webserver config level.
Apache:
<FilesMatch ".+\.twig$">
<IfModule mod_authz_core.c>
# Apache 2.4
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order deny,allow
Deny from all
</IfModule>
</FilesMatch>
Nginx:
location ~- \.twig$ {
deny all;
}
I have a custom non WordPress function I would like to call, and tried the Timber docs with the examples mentioned there but it only throws errors.
Basically I would like to call the following function in the templates where needed with arguments to return the appropriate SVG Icon.
function get_svg_icon( $icon , $class = NULL ) { $svg = '<svg class="icon icon-' . $icon . ' ' . $class . '"><use xlink:href="'. get_bloginfo('template_url') . '/dist/assets/icons/symbol-defs.svg#' . $icon . '"></use></svg>'; return $svg; }
Hello,
I just inspected the code in assets/scripts/ExternalScriptLoader
and it seems to be used nowhere. Is it a bug?
Hi guys. Many thanks for all your work.
Could you please clarify if there is a possibility to move a component to another page? It seems like a very basic functionality, however I wasn't able to do this, no matter how long I was trying to. Let's assume I have some component with lots of data set up for a homepage, and I want to move it to some other page with all its data, is it correct that I will need to enter all content once again? That may be unbelievable waste of time.
I was trying a few plugins, like ACF Extended, but it didn't help with the problem, the only thing I noticed is possibility to clone component within same page, but not to another one.
Thanks a lot in advance for your help!
Alex
When I activate the Yoast SEO plugin, I get this fatal error:
Fatal error: Uncaught Error: Class 'Flynt\Init' not found in /Users/spencer/DEKSIA/flynt/wp-content/themes/flynt/functions.php:16 Stack trace: #0 /Users/spencer/DEKSIA/flynt/wp-settings.php(497): include() #1 /Users/spencer/DEKSIA/flynt/wp-config.php(90): require_once('/Users/spencer/...') #2 /Users/spencer/DEKSIA/flynt/wp-load.php(37): require_once('/Users/spencer/...') #3 /Users/spencer/DEKSIA/flynt/wp-admin/admin.php(34): require_once('/Users/spencer/...') #4 /Users/spencer/DEKSIA/flynt/wp-admin/plugins.php(10): require_once('/Users/spencer/...') #5 {main} thrown in /Users/spencer/DEKSIA/flynt/wp-content/themes/flynt/functions.php on line 16
Heyho. I recently fell in love with GatsbyJS and would love to try Flynt out in combination with Gatsby to create static websites. Did you ever had a thought on that or have an idea how this could be implemented with the current Flynt stack?
Is there a way to get page components via the WPJSON API or do we need to make adjustments to make FlyntWP headless compatible?
Hey guys, I installed your theme to my local wordpress but I can't seem to run it properly. I get to position 5. "Run npm run start and start developing. Your local server is available at localhost:3000."
I run the command, Windows Firewall is asking for permission, but after that, I get a message from my browser, that the webserver is not responding. I can open my wordpress installation and see that the theme is installed correctly. But I can't access the localhost:3000.
I tried googling but that didn't help yet. Obviously. ;) So it would be very nice to hear from you guys.
Regards,
Michael
WooCommerce orders are not listed on My Account page.
This is happening because the HideProtectedPosts
feature is manipulating the query, adding wp_posts.post_password = ''
.
Hi guys,
i installed Flynt, changed the const host to localhost and called https:localhost:3000.
Then i installed the plugin that you have to install and after reloading the page i got this error.
Maybe someone could get me a hint what to do now ;-)
Fatal error: Uncaught Error: Call to undefined function Flynt\Utils\acf_add_options_page() in C:\xampp\htdocs\wp-content\themes\flynt\lib\Utils\Options.php:77 Stack trace: #0 C:\xampp\htdocs\wp-content\themes\flynt\lib\Utils\Options.php(96): Flynt\Utils\Options::createOptionPage('global') #1 C:\xampp\htdocs\wp-content\themes\flynt\lib\Utils\Options.php(204): Flynt\Utils\Options::createOptionSubPage('global', 'Default') #2 C:\xampp\htdocs\wp-content\themes\flynt\lib\Utils\Options.php(199): Flynt\Utils\Options::addOptions('Acf', Array, 'global', 'Default') #3 C:\xampp\htdocs\wp-content\themes\flynt\inc\acf.php(33): Flynt\Utils\Options::addGlobal('Acf', Array) #4 C:\xampp\htdocs\wp-content\themes\flynt\lib\Utils\FileLoader.php(66): require_once('C:\xampp\htdocs...') #5 [internal function]: Flynt\Utils\FileLoader::Flynt\Utils{closure}(Object(DirectoryIterator)) #6 C:\xampp\htdocs\wp-content\themes\flynt\lib\Utils\FileLoader.php(34): call_user_func(Object(Closure), Object(DirectoryIterator)) #7 C:\xampp\htdocs\wp-content\th in C:\xampp\htdocs\wp-content\themes\flynt\lib\Utils\Options.php on line 77
Hi, I'm using Flynt Premium. I unzipped the file into the theme\flynt\Components\ folder.
I am getting the following error message:
Fatal error: Uncaught Twig\Error\LoaderError: Unable to find template
"D:/Bitnami2/project-sunshine/apps/wordpress/htdocs/wp-content/themes/flynt/Components/PremiumComponents/HeroImageText/index.twig"
(looked into:
D:\Bitnami2\project-sunshine\apps\wordpress\htdocs\wp-content\themes\flynt,
D:\Bitnami2\project-sunshine\apps\wordpress\htdocs\wp-content\themes\flynt\views, ,
D:\Bitnami2\project-sunshine\apps\wordpress\htdocs\wp-content\themes\flynt\Components\PremiumComponents/HeroImageText).
in D:\Bitnami2\project-sunshine\apps\wordpress\htdocs\wp-content\themes\flynt\templates\page.twig:5
Stack trace: #0 D:\Bitnami2\project-sunshine\apps\wordpress\htdocs\wp-content\themes\flynt\vendor\twig\twig\src\Loader\FilesystemLoader.php(150):
Twig\Loader\FilesystemLoader->findTemplate('D:/Bitnami2/pro...') #1 D:\Bitnami2\project-sunshine\apps\wordpress\htdocs\wp-content\themes\flynt\vendor\twig\twig\src\Environment.php(299):
Twig\Loader\FilesystemLoader->getCacheKey('D:\Bitnami2\pro...')
#2 D:\Bitnami2\project-sunshine\apps\wordpre in D:\Bitnami2\project-sunshine\apps\wordpress\htdocs\wp-content\themes\flynt\templates\page.twig on line 5
The HeroImageText components file is in the directory. Although I did notice a back-slash right before the component name e.g. \PremiumComponent/HeroImageText .
Any help debugging would be appreciated.
Hello!
I'm planning implement our application as a WordPress plugin plus some Composer packages and use Flynt.
What would you suggest to send content (HTML output) from the plugin to Flynt?
I'd like something better (something OOP) than shortcodes or actions.
What do you have to offer?
Cc: @Jony-Shark
Browser-sync does not inject component-specific SCSS and JS even if it compiles successfully. What could it be?
Considering that Flynt disables the Gutenberg by default, we can safely remove Gutenberg styles from the head tag:
/**
* Remove Gutenberg default styles
*/
add_action('wp_print_styles', function (): void {
wp_dequeue_style('wp-block-library');
wp_dequeue_style('wp-block-library-theme');
});
I can make a PR to add this to the core.
I am trying to use this on a dev project but I've tried 4 different times in different ways to install it and it doesn't work.
The instructions say to run composer install
, that works.
Then it says to run npm install
, this works, though it the audit complains about a lot of packages.
It's running npm run build
that won't work. I get multiple of these:
npm ERR! code ELIFECYCLE
Part of the issue is that the build command doesn't use a syntax that Windows can use. For example it can't just run NODE_ENV=production....
. You have to use the set
command for environment vars.
And then it uses a variable $npm_execpath
which doesn't do anything.
It runs gulp
command but that doesn't seem to be installed by npm? I had to install that globally for it to work like this.
The linter commands fail.
I've tried this 3 times with fresh clones from Git in different paths on my computer, using two tools (AMPPS, and Local by Flywheel), neither worked. Flywheel was the worst, npm install didn't even work, it had a lot of permissions errors.
Then I downloaded a live/working version of a Flynt theme and ran npm install on it, then tried to run build and it still didn't work.
I'm not sure what else to try and fix! I tried to do npm update
just to see if updating packages across the board would work, and it didn't.
Here is the output in my CLI:
D:\www\www\temp-site\wp-content\themes\test-theme ([email protected])
$ npm run build
> [email protected] build D:\www\www\temp-site\wp-content\themes\test-theme
> check-node-version --package -p && npm run clean && set NODE_ENV=production webpack --progress --display=minimal && gulp rev
node: 10.16.0
npm: 6.10.2
npx: 6.10.2
yarn: 1.17.3
> [email protected] clean D:\www\www\temp-site\wp-content\themes\test-theme
> rm -rf ./dist
[16:34:05] Using gulpfile D:\www\www\temp-site\wp-content\themes\test-theme\gulpfile.js
[16:34:05] Starting 'rev'...
[16:34:05] Starting 'revAssets'...
[16:34:05] Finished 'revAssets' after 122 ms
[16:34:05] Starting 'revUpdateReferences'...
[16:34:05] 'revUpdateReferences' errored after 15 ms
[16:34:05] Error: File not found with singular glob: D:/www/www/temp-site/wp-content/themes/test-theme/dist\rev-manifest.json (if this was purposeful, use `allowEmpty` option)
at Glob.<anonymous> (D:\www\www\temp-site\wp-content\themes\test-theme\node_modules\glob-stream\readable.js:84:17)
at Object.onceWrapper (events.js:286:20)
at Glob.emit (events.js:198:13)
at Glob.EventEmitter.emit (domain.js:448:20)
at Glob._finish (D:\www\www\temp-site\wp-content\themes\test-theme\node_modules\glob\glob.js:197:8)
at done (D:\www\www\temp-site\wp-content\themes\test-theme\node_modules\glob\glob.js:182:14)
at Glob._processSimple2 (D:\www\www\temp-site\wp-content\themes\test-theme\node_modules\glob\glob.js:688:12)
at D:\www\www\temp-site\wp-content\themes\test-theme\node_modules\glob\glob.js:676:10
at Glob._stat2 (D:\www\www\temp-site\wp-content\themes\test-theme\node_modules\glob\glob.js:772:12)
at lstatcb_ (D:\www\www\temp-site\wp-content\themes\test-theme\node_modules\glob\glob.js:764:12)
[16:34:05] 'rev' errored after 144 ms
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `check-node-version --package -p && npm run clean && set NODE_ENV=production webpack --progress --display=minimal && gulp rev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\vigil\AppData\Roaming\npm-cache\_logs\2019-09-11T23_34_05_389Z-debug.log
D:\www\www\temp-site\wp-content\themes\test-theme ([email protected])
You'll notice I changed the build commands to at least try to get them working on Windows, but it still fails with the gulp rev
stuff it seems like.
I don't know what else to try.
Thanks for any help
I made the file like the following:
themes\flynt\Components\SiteFooter\Widgets\WPMobileAppNavMenuWidget.php
and that file content like the following:
<?php
namespace Flynt\Components\SiteFooter\Widgets;
use WP_Widget;
class WPMobileAppNavMenuWidget extends WP_Widget
{
....
}
and I tried to use above Class in themes\flynt\Components\SiteFooter\functions.php
like this
<?php
namespace Flynt\Components\SiteFooter;
use Flynt\Components\SiteFooter\Widgets\WPMobileAppNavMenuWidget;
add_action('widgets_init', function () {
register_widget('Flynt\Components\SiteFooter\Widgets\WPMobileAppNavMenuWidget');
})
but it didn't worked. so I added the require function like the following
<?php
namespace Flynt\Components\SiteFooter;
require_once dirname(__FILE__) . '/Widgets/WPMobileAppNavMenuWidget.php';
add_action('widgets_init', function () {
register_widget('Flynt\Components\SiteFooter\Widgets\WPMobileAppNavMenuWidget');
})
after that, code is working.
but I would like to avoide to use require_once.
how can I do this on Flynnt theme?
thanks
Hey FlyntWP / bleech team! Hope everything is fine!
For the last 4 days I played around with the new ACF Pro Gutenberg Blocks in ACF Pro 5.8 and I think it's now way easier to register Flynt components into Gutenberg and also load necessary style and javascript files for the admin area.
I worked on a prototype and got dynamic component registration working for Gutenberg outside of the Flynt ecosystem. I started to implement optional Gutenberg component registration and Component rendering into the Flynt theme yesterday and look forward to send a pull request very soon.
Are you already working on something similar?
My current state looks as following:
useGutenberg
protected static variable in the Defaults
classuseGutenberg(false)
into the Init.phpNow I'm working on the registration via acf_register_block_type() and updating the renderer to use the_content() if Gutenberg is enabled instead of the dynamic renderer via the ACF layout field.
Obviously there are some differences and incompatibilities with the ACF layout approach and the Gutenberg approach.
I also think there should be an option to remove the default Wordpress blocks to keep Flynt components clean and simple and avoid mixing them with default Wordpress blocks.
Happy to hear from you and have some insights or thoughts from you.
PS:
The new and simpler approach back to the Wordpress roots is really refreshing and fun to work with! Great job!
I have searched the whole front-end codes of Flynt to find jQuery usages and got the following results:
All of the functions above could be written in lightweight vanilla js for better optimization, speedup page loads, and reduce depending on massive old libraries like jquery. What do you think about getting rid of jquery?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.