One feature that would make Themler killer

Stagger Lee
1818 Posts
Stagger Lee posted this 24 April 2015

Homepage, frontpage layout.

  • Option to make it possible to insert custom Themler template inside Themler template.
  • We could name them as our categories and Themler would beat all those commercial fancy WordPress themes with very special Home layouts.

It could be done with widgets positions and widgets for Posts listings. But then not possible to use very good Bootstrap and listing in multiple columns. Not without heavy manual tweaking. And styling for responsive is hedache.

  • Option can be very minimalistic.
  • We are editing Home template (or some custom Home template)
  • We insert one row with one column (or some other block)
  • Then we insert CMS Content Sidebar (not widget position)
  • We dont need header, menu, other sidebars, footer, etc...

Themler would need to give option to handle this CMS Content Sidebar as separate custom template, and give us option to name it, filename.

Look at Recipology theme and homepage. Imagine all those page wide blocks as separate WP loops, pulled from separate PHP archive templates. And not as now HTML blocks, or widgets display.
Rest can we do manually. It is easy to limit number of posts per loop with simple snippets.

It is all about the nice Themler part, Bootstrap. All this can be done with widgets, but then forget about Themler Bootstrap. Or Themler editing at all.

Homepage, frontpage layout. - Option to make it possible to insert custom Themler template inside Themler template. - We could name them as our categories and Themler would beat all those commercial fancy WordPress themes with very special Home layouts. It could be done with widgets positions and widgets for Posts listings. But then not possible to use very good Bootstrap and listing in multiple columns. Not without heavy manual tweaking. And styling for responsive is hedache. - Option can be very minimalistic. - We are editing Home template (or some custom Home template) - We insert one row with one column (or some other block) - Then we insert CMS Content Sidebar (not widget position) - We dont need header, menu, other sidebars, footer, etc... Themler would need to give option to handle this CMS Content Sidebar as separate custom template, and give us option to name it, filename. Look at Recipology theme and homepage. Imagine all those page wide blocks as separate WP loops, pulled from separate PHP archive templates. And not as now HTML blocks, or widgets display. Rest can we do manually. It is easy to limit number of posts per loop with simple snippets. It is all about the nice Themler part, Bootstrap. All this can be done with widgets, but then forget about Themler Bootstrap. Or Themler editing at all.
Vote to pay developers attention to this features or issue.
34 Comments
Order By: Standard | Newest
Linkebel
161 Posts
Linkebel posted this 01 February 2016

Great !!!

Thank you ;-)

Great !!! Thank you ;-)
Stagger Lee
1818 Posts
Stagger Lee posted this 01 February 2016

I made mistake, spreading votes between two topics. Vote there if you find this appealing:

https://answers.themler.com/questions/57385/new-killer-feature-mini-templates-inside-one-template

I made mistake, spreading votes between two topics. Vote there if you find this appealing: https://answers.themler.com/questions/57385/new-killer-feature-mini-templates-inside-one-template
Stagger Lee
1818 Posts
Stagger Lee posted this 04 February 2016

Some updated code, better for performance:

<?php
// WP_Query arguments
$args = array (
'post_type' => array( 'post' ),
'post_status' => array( 'publish' ),
'cat' => '193',
// 'category_name' => 'possimus-aliquid-beatae-eos-odit',
// 'fields' => 'ids',
// Skip SQL_CALC_FOUND_ROWS for performance (no pagination).
'no_found_rows' => true, // counts posts, remove if pagination required
// 'nopaging' => false,
// 'paged' => '1',
'posts_per_page' => '4',
'ignore_sticky_posts' => false,
'no_found_rows' => true,
// 'offset' => '1',
'order' => 'DESC',
'orderby' => 'date',
'cache_results' => false,
'update_post_term_cache' => false, // grabs terms, remove if terms required (category, tag...)
'update_post_meta_cache' => false, // grabs post meta, remove if post meta required
);

// The Query
query_posts($args);

//Get the Posts
theme_blog_9();

// Restore original Post Data
wp_reset_postdata();
?>

Some updated code, better for performance: &lt;?php // WP_Query arguments $args = array ( 'post_type' =&gt; array( 'post' ), 'post_status' =&gt; array( 'publish' ), 'cat' =&gt; '193', // 'category_name' =&gt; 'possimus-aliquid-beatae-eos-odit', // 'fields' =&gt; 'ids', // Skip SQL_CALC_FOUND_ROWS for performance (no pagination). 'no_found_rows' =&gt; true, // counts posts, remove if pagination required // 'nopaging' =&gt; false, // 'paged' =&gt; '1', 'posts_per_page' =&gt; '4', 'ignore_sticky_posts' =&gt; false, 'no_found_rows' =&gt; true, // 'offset' =&gt; '1', 'order' =&gt; 'DESC', 'orderby' =&gt; 'date', 'cache_results' =&gt; false, 'update_post_term_cache' =&gt; false, // grabs terms, remove if terms required (category, tag...) 'update_post_meta_cache' =&gt; false, // grabs post meta, remove if post meta required ); // The Query query_posts($args); //Get the Posts theme_blog_9(); // Restore original Post Data wp_reset_postdata(); ?&gt;
shaulhadar
447 Posts
shaulhadar posted this 22 April 2016

Stagger, what is the best way to achieve this currently? There are a lot of posts about this....

Stagger, what is the best way to achieve this currently? There are a lot of posts about this....
Stagger Lee
1818 Posts
Stagger Lee posted this 22 April 2016

Page templates. No need to make category templates, it is complicated.
All TH needs is post loop, to be able to work with its options inside this block.

More I think about it more I see it would be very easy for TH developers to make it as real TH options.
Problem is they work by logic "All or nothing". We dont need to start with same options for Magento, Joomla etc....Options for WordPress to start with are very fine for us.

Page templates. No need to make category templates, it is complicated. All TH needs is post loop, to be able to work with its options inside this block. More I think about it more I see it would be very easy for TH developers to make it as real TH options. Problem is they work by logic "All or nothing". We dont need to start with same options for Magento, Joomla etc....Options for WordPress to start with are very fine for us.
Stagger Lee
1818 Posts
Stagger Lee posted this 22 April 2016

If you want it add code in Settings Additional CMS code for enabling PHP code inside widgets. And you can add code above directly in widgets. This way you have more visual control when it gets to much to handle (to many blocks per one template)
Name Widget controls (positions) by some logic names, best after category (home-cars).

One thing you cannot avoid (right now) is to make hidden Page templates for all separate blocks on Home template. Otherways TH doesnt know where to change layout / design. It would mix templates and change settings where you dont want it. Dont forget to click all 3 instances "Customize template style" for all hidden Page templates (very important).

It is easy, just try it. Later all blocks you edit and style directly in Home template. Just click inside and edit, no need to go to the hidden Page templates anymore.

If you want it add code in Settings Additional CMS code for enabling PHP code inside widgets. And you can add code above directly in widgets. This way you have more visual control when it gets to much to handle (to many blocks per one template) Name Widget controls (positions) by some logic names, best after category (home-cars). One thing you cannot avoid (right now) is to make hidden Page templates for all separate blocks on Home template. Otherways TH doesnt know where to change layout / design. It would mix templates and change settings where you dont want it. Dont forget to click all 3 instances "Customize template style" for all hidden Page templates (very important). It is easy, just try it. Later all blocks you edit and style directly in Home template. Just click inside and edit, no need to go to the hidden Page templates anymore.
Stagger Lee
1818 Posts
Stagger Lee posted this 22 April 2016

Or you can make shortcodes of PHP code above. And use shortcodes in widgets. To avoid security risks by enabling PHP code inside widgets.

https://generatewp.com/shortcodes/

Or you can make shortcodes of PHP code above. And use shortcodes in widgets. To avoid security risks by enabling PHP code inside widgets. https://generatewp.com/shortcodes/
Stagger Lee
1818 Posts
Stagger Lee posted this 22 April 2016

Here is much simpler method. Made it just today.

  • Make as many hidden Page templates as you need category loop blocks on Homepage
    (this one you cannot get rid of, unless TH developers make it done in background)

  • Where you want your mini-loops on Homepage insert Wp Widget Areas controls.

  • Name them logically, chose yourself names.

  • Insert this code in Settings --> Additional CMS Code:

// Add Shortcode
function home_block_shortcode( $atts ) {

// Attributes
extract( shortcode_atts(
array(
'category_id' => '',
'theme_blog_id' => '',
'posts' => '',
), $atts )
);

// Code

// define query parameters based on attributes
$options = array(
'posts_per_page' => $posts,
'cat' => $category_id,
);

query_posts($options);
$output = call_user_func('theme_blog_' . $theme_blog_id);
//Get the Posts
$output;
wp_reset_query();
wp_reset_postdata();
}
add_shortcode( 'home-block', 'home_block_shortcode' );

  • Use this shortcode in newly added widgets:

[home-block category_id=1184 theme_blog_id=22 posts=3]

category_id = your category ID you want to loop your Posts from.
theme_blog_id = number of your hidden Page template inside "includes" subfolder. 9 = theme_blog_9();
posts = number of posts per mini-loop block.

This way you can reuse PHP code and not meddle with many CMS Code controls. Can be confusing if there are to many.

Here is much simpler method. Made it just today. - Make as many hidden Page templates as you need category loop blocks on Homepage (this one you cannot get rid of, unless TH developers make it done in background) - Where you want your mini-loops on Homepage insert Wp Widget Areas controls. - Name them logically, chose yourself names. - Insert this code in Settings --> Additional CMS Code: // Add Shortcode function home_block_shortcode( $atts ) { // Attributes extract( shortcode_atts( array( 'category_id' =&gt; '', 'theme_blog_id' =&gt; '', 'posts' =&gt; '', ), $atts ) ); // Code // define query parameters based on attributes $options = array( 'posts_per_page' =&gt; $posts, 'cat' =&gt; $category_id, ); query_posts($options); $output = call_user_func('theme_blog_' . $theme_blog_id); //Get the Posts $output; wp_reset_query(); wp_reset_postdata(); } add_shortcode( 'home-block', 'home_block_shortcode' ); - Use this shortcode in newly added widgets: > [home-block category_id=1184 theme_blog_id=22 posts=3] category_id = your category ID you want to loop your Posts from. theme_blog_id = number of your hidden Page template inside "includes" subfolder. 9 = theme_blog_9(); posts = number of posts per mini-loop block. This way you can reuse PHP code and not meddle with many CMS Code controls. Can be confusing if there are to many.
shaulhadar
447 Posts
shaulhadar posted this 23 January 2017

Hi Stagger, this is a great method... is there by any chance a video you did for the updated version with the latest method? i am trying to do this but i am not sure....

Hi Stagger, this is a great method... is there by any chance a video you did for the updated version with the latest method? i am trying to do this but i am not sure....
Stagger Lee
1818 Posts
Stagger Lee posted this 23 January 2017

Shaul,

do you maybe try to do it with custom post type ? Not "Posts" type.

Shaul, do you maybe try to do it with custom post type ? Not "Posts" type.
shaulhadar
447 Posts
shaulhadar posted this 23 January 2017

Yeah, man, i just noticed my mistake, thanks , this method is realy great!

I hope themler team will put something like this...
maybe in the future when there is the sdk we will be able to build this control straight into themler itself..

Yeah, man, i just noticed my mistake, thanks , this method is realy great! I hope themler team will put something like this... maybe in the future when there is the sdk we will be able to build this control straight into themler itself..
Stagger Lee
1818 Posts
Stagger Lee posted this 23 January 2017

There are not many WP_Query attributes/parameters. They could make them all as simple select dropdown and visible small input field for our manual, custom input.
As option to chose custom (hidden) template again select dropdown can be used and template chosen. Themler would in background do its thing, add to the code for instance:
//Get the Posts
theme_blog_9();

Everything else is already in TH. Just new hidden templates could be made automatically without header & footer, and automatically set "Customize this template" for unique style and edit.

There are not many **WP_Query** attributes/parameters. They could make them all as simple select dropdown and visible small input field for our manual, custom input. As option to chose custom (hidden) template again select dropdown can be used and template chosen. Themler would in background do its thing, add to the code for instance: //Get the Posts theme_blog_9(); Everything else is already in TH. Just new hidden templates could be made automatically without header & footer, and automatically set "Customize this template" for unique style and edit.
Stagger Lee
1818 Posts
Stagger Lee posted this 23 January 2017

Same way Mega Menu can be done. As it is now it is very limited and not much useful.

Same way Mega Menu can be done. As it is now it is very limited and not much useful.
alegenqua
7 Posts
alegenqua posted this 26 May 2017

Stagger Lee, you have to ask money to billion... because you're supporting alone the best feature we can need. thank you

Stagger Lee, you have to ask money to billion... because you're supporting alone the best feature we can need. thank you
You must log in or register to leave comments