Uladzimir Kulesh
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Developing theme with @wordpress/scripts@dilip2615 thanks, but css files is still minimized and have no comments. May be
optimization: { minimize: false, }
works only for js-files? Because my js files now look like this:
/******/ (() => { // webpackBootstrap
/******/ "use strict";
;// ./src/js/components/theme-options.js
function themeOptions() {
console.log('A foo walks into a bar, takes a look around and says "Hello World!"');
}
;// ./src/js/global.js
themeOptions();
/******/ })()
;Forum: Developing with WordPress
In reply to: Developing theme with @wordpress/scriptsHello, @dilip2615, thank you! But this code didn’t work for me: css code still unminified, server give an error “Invalid options object. Dev Server has been initialized using an options object that does not match the API schema…”. Maybe I made a mistake, can you check my
webpack.config.js
code:// WordPress webpack config.
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
// Plugins.
const RemoveEmptyScriptsPlugin = require( 'webpack-remove-empty-scripts' );
// Utilities.
const path = require( 'path' );
// Add any new entry points by extending the webpack config.
module.exports = {
...defaultConfig,
...{
entry: {
'js/global': path.resolve( process.cwd(), 'src/js', 'global.js' ),
'css/screen': path.resolve( process.cwd(), 'src/scss', 'screen.scss' ),
'css/editor': path.resolve( process.cwd(), 'src/scss', 'editor.scss' ),
},
plugins: [
// Include WP's plugin config.
...defaultConfig.plugins,
// Removes the empty.js
files generated by webpack but
// sets it after WP has generated its*.asset.php
file.
new RemoveEmptyScriptsPlugin( {
stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS
} )
],
optimization: {
minimize: false
},
devServer: {
proxy: 'https://test.local/',
}
}
};Forum: Reviews
In reply to: [Turanga] Awesome theme!@c77 thank you!
Forum: Developing with WordPress
In reply to: How to add current-menu-item class to menu item?@threadi thanks for your help!
- This reply was modified 5 months, 3 weeks ago by Uladzimir Kulesh.
Forum: Developing with WordPress
In reply to: How to add current-menu-item class to menu item?@threadi : “But, however: your plugin does not seem to reset the permalink cache itself. If you install the plugin, then create a portfolio entry and want to view it, you end up on a 404 page.”
Can you tell me where I can read about how to clear the cache when installing the plugin?
Forum: Developing with WordPress
In reply to: How to add current-menu-item class to menu item?@threadi If you pin the project page to the menu, then yes, everything works. But I’m talking about the archive page – a page with a list of all projects:
“All projects from it are displayed on the page /portfolio (I use ‘rewrite’ => array( ‘slug’ => ‘portfolio’ )). Previously, before the WordPress editor was extended to full site editing, the specified class was automatically added to the menu item when visiting the portfolio page (with a list of all projects).”
Forum: Developing with WordPress
In reply to: How to add current-menu-item class to menu item?@threadi : “If this does not currently happen with your theme, the question would be how you have defined the menu in it? TwentyTwentyFour uses the navigation block that provides this marking.”
I also use the navigation block. The problem is not in the file theme.json, but in the fact that for a custom post type in the menu, adding a class “current-menu-item” does not work.
Forum: Developing with WordPress
In reply to: How to add current-menu-item class to menu item?@threadi I’m developing my own theme, but I understand that this would be true for any block theme. The Twenty Twenty-Four theme has the same problem. Here’s the plugin I’m using: https://www.ads-software.com/plugins/uk-portfolio/. And a screenshot:
Link to image: https://uladzimirkulesh.com/screenshot.png
- This reply was modified 5 months, 3 weeks ago by Uladzimir Kulesh.
Forum: Developing with WordPress
In reply to: Custom query based on metabox valueGerry, thank you! Solving the issue with a block is even better for me!