Custom post types and namespacing


Hello Jimmy, Could you please show us the code you use to display these custom queries ? Mat


Hi Jimmy,

To call a class or a function from global namespace inside another namespace, call it with a backslash before. e.g. new \WP_Query();.

BTW to create a custom loop with Beans:

beans_add_filter( 'beans_loop_query_args[_my_custom_loop]', array(
 // new query args here.
) );

beans_loop_template( 'my_custom_loop' );

That worked perfectly. Not sure how I missed this in the doc but thank you for taking the time to reply and help me out. I greatly appreciate it Joseph!

Write a reply

Login or register to write a reply, it's free!