Remove unused block, module and template from the main theme

Posted in: Newspaper
Post count: 2

Hi,
I’m using the last version of Newspaper.
The file “td_config.php” is very huge and very slow to load.
How I can remove from the child theme the unused block, module to speed up the loading?
(I think is better to have the additional block, module, template in a separate plugin).
Thanks in advance.
Giovanni.

Post count: 20688

Hi,

That file is not supported to be modified in a child theme
https://forum.tagdiv.com/the-child-theme-support-tutorial/
It is a critical file of the theme. Best you do not modify it in any way (or make a backup if you do), or there could be problems. Try to optimize the website by other means, instead of removing code from the theme files.

Why exactly do you want to delete the blocks and modules files? You can use any block type you want in pages, only those will be loaded. If you want to optimize more, maybe try and use fewer block types with same modules
https://forum.tagdiv.com/theme-blocks-modules/
Reduce the number of blocks with pagination as well.

Also check the theme requirementsr guide for a proper functionality
https://forum.tagdiv.com/requirements-for-newspaper/

Thanks

Post count: 2

The problem is that style.css include style for all modules and blocks even if I use only one block type. The file style.css is 1.1MB (900K minified): very big! Is possible to dynamically generate the css only for the used block or template? The theme ionMag have additional block and modules in external plugin and for this reason the style.css file is only 450K (340KB minified). In newspaper theme the file td_config.php is 900KB and takes 0.2 seconds to execute (on my VPS). My question: is possible to make the theme “modular” so I can decide which modules or blocks to enable in order to reduce the size of every page of the site?
Alternatively, it would be sufficient to have a minimal theme with only one block/template/module type and add other type, if necessary, in the child theme with the wp_booster API.
Is possible to have a “minimal” version of the newspaper theme?

Thank in advance.
Excuse me for my bad English.

Post count: 20688

Hi,

The theme stylesheet should contain all the CSS necessary for all elements. Removing block code from the theme files will not affect the stylesheet.
Most users minify the stylesheet for a smaller size, that would be the only proper way of reducing it.

Newspaper although similar in some way to the discontinued ionmag theme, does not share the same plugin system. All the elements are included by default, ionmag had a free version and a premium version. The difference was the premium plugins. Newspaper includes them all in one package.

In the end it depends on what pages contain, they can have multiple grids and blocks and be heavy on resources, or contain fewer elements.
So the same functionality by plugins as with ionmag would not be possible with Newspaper.

Check the forum, there are many speed optimization topics you can follow, provided by theme users.

Thanks

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.