Answer the question
In order to leave comments, you need to log in
How to make your own framework for WordPress?
Good afternoon, I apologize in advance for the perhaps not quite clear worded question.
In general, I have been using wordpress for my sites for a long time and I put all the themes on the unyson framework, I have studied all its documentation with it and now I calmly make custom blocks of any complexity.
In simple words, for each custom block, I choose pictures, texts and other settings, they are written to the database and then pulled up when building the page, inserted into my html code. So the question is how to create the most simple framework like unyson , because. I couldn't find anything similar on the net, maybe I didn't search well enough. I would be grateful if someone would share an article or a link to the documentation where it is relatively easy to explain how to create simple WordPress frameworks.
Answer the question
In order to leave comments, you need to log in
Decide which functionality you use the most. But which is not out of the box. Or simplification of function calls out of the box.
Then write it.
In fact, it really speeds up the work, in the process, if necessary, modify the modules.
I have a double structure, for large projects that require a lot of custom functionality and libraries I put the whole thing.
For not large projects, I single out the mast-have in the theme folder.
If everything is taken into account, then everything is very simple, usually further.
for example, this is how setting up breadcrumbs for the theme design looks like
function wpp_br_breadcrumbs_classes( $classes ) {
$classes = [
'wrap_class' => 'breadcrumb breadcrumb--overflow responsive-gutter section-padding-small',
'item_class' => 'wpp_br_item',
'link_class' => 'breadcrumb-item'
];
return $classes;
}
add_filter( 'wpp_fr_breadcrumbs_classes', 'wpp_br_breadcrumbs_classes' );
function wpp_theme_register_taxonomy( $args ) {
$args[ 'sliders' ] = [
'hierarchical' => true,
'post_types' => [ 'slider' ],
'single' => 'Слайдер',
'plural' => 'Слайдеры',
'genitive' => 'Слайдер',
'cir' => true
];
return $args;
}
Open source is the best helper in this case. https://github.com/ThemeFuse/Unyson
In general, WP itself is quite extensible, without any frameworks, it just doesn't look so concise.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question