S
S
sergeksnsd2020-06-22 17:03:43
WordPress
sergeksnsd, 2020-06-22 17:03:43

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

3 answer(s)
W
WP Panda, 2020-06-22
@wppanda5

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.
c53a6c14e3.jpg
For not large projects, I single out the mast-have in the theme folder.
ebe5b57372.jpg
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' );

This is how registering a new taxonomy
function wpp_theme_register_taxonomy( $args ) {
    
    $args[ 'sliders' ] = [
      'hierarchical' => true,
      'post_types'   => [ 'slider' ],
      'single'       => 'Слайдер',
      'plural'       => 'Слайдеры',
      'genitive'     => 'Слайдер',
      'cir'          => true
    ];


    return $args;
  }

well, etc.

A
Arseny, 2020-06-22
Matytsyn @ArsenyMatytsyn

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.

L
Leonid, 2020-06-22
@caballero

WordPress framework is absurd.
WordPress is essentially a CMS
Usually CMS are built on the basis of frameworks and not vice versa
For WordPress, just write the desired module

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question