How to use the code which should be used in more theme's files
I'm speaking about such kind of code as menu, footer, header, sidebar. You can't put the code in all files where you need. Midrub has a feature, called parts which allows to work with this kind of the code.
So, how the parts works? Create a directory in your theme contents/parts and put there files with code which should be used in more files. After this, use the function get_theme_part to include the file.
How the function get_theme_part works? Supposing you have the file menu.php and header.php, you just have to write this code:
- get_theme_part('menu') - to include the menu.php
- get_theme_part('header') - to include the header.php
With get_theme_part you can easy create a professional theme for Midrub Frontend.
- get_pagination - displays pagination for contents
- the_pagination - create a pagination as you need
- the_db_request in midrub frontend themes
- Get the theme's path in a Midrub Theme
- How to use the text from laguage files in a Midrub's theme
- How to use the code which should be used in more theme's files
- Midrub Frontend Theme Structure
- Frontend Themes Introduction
- Themes Introduction