We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function beans_loop_template( $id = false ) { // Set default loop id. if ( ! $id ) { $id = 'main'; } // Only run new query if a filter is set. if ( $_has_filter = beans_has_filters( "beans_loop_query_args[_{$id}]" ) ) { global $wp_query; /** * Filter the beans loop query. This can be used for custom queries. * * @since 1.0.0 */ $args = beans_apply_filters( "beans_loop_query_args[_{$id}]", false ); $wp_query = new WP_Query( $args ); } // beans template filter is set. $templates = beans_apply_filters( "beans_template", false ); $templates = ($templates) ? $templates : BEANS_STRUCTURE_PATH . 'loop.php'; $file = basename($templates); if ( '' == locate_template( $file, true, false ) ) { require( $templates ); } // Only reset the query if a filter is set. if ( $_has_filter ) { wp_reset_query(); } }
beans_add_filter('beans_template', 'beans_post_template'); function beans_post_template() { if (is_singular('post')) { $file = BEANS_STRUCTURE_PATH . 'post.php'; return $file; } }
The text was updated successfully, but these errors were encountered:
@ehababdo I owe you a big apology for such a huge delay in getting back to you on your filter request. I'm very sorry.
Let's talk about your filter request. You'd like the ability to filter the loop template in your child theme.
Tell me more.
A few questions I have are:
loop.php
Sorry, something went wrong.
No branches or pull requests
For Example - filter is set
add_filter
The text was updated successfully, but these errors were encountered: