1 tilqicom Jun 24, 2010 12:38
3 tilqicom Jun 24, 2010 13:28
¥åßßå wrote:
Top of your index_main.php
if( !defined( 'whatever-var-it-is' ) ) die() global $posttypes_reserved_IDs; $posttypes_reserved_IDs = array_merge( $posttypes_reserved_IDs, array( your-new-post-ids-comma-separated ) ); // rest of file
¥
what is 'whatever-var-it-is' ? the custom disp ?
i could not understand exactly what the above code does.. i am not trying to merge anything, the post loop includes all post types already, iam trying to split/filter them by 3
4 yabba Jun 24, 2010 14:03
The whatever var is EVO_APP_LOADED or something, it's in pretty much every file near the top.
Adding the above code, after replacing it with your new post ID's will remove them from the normal post loop
¥
5 tilqicom Jun 24, 2010 15:11
¥åßßå wrote:
The whatever var is EVO_APP_LOADED or something, it's in pretty much every file near the top.
Adding the above code, after replacing it with your new post ID's will remove them from the normal post loop
¥
following your explanations, i ve put this:
if( !defined( 'EVO_MAIN_INIT' ) ) die( 'Please, do not access this page directly.' );
global $posttypes_reserved_IDs;
$posttypes_reserved_IDs = array_merge( $posttypes_reserved_IDs, array( 5001, 5002 ) );
But nothing happens really, everything is the same
6 yabba Jun 24, 2010 16:03
Oh yeah, forgot about that evo bug :p
The list is hard coded in itemlislight.class.php ( and it should be $posttypes_locked_IDs )
¥
7 tilqicom Jun 24, 2010 16:09
¥åßßå wrote:
Oh yeah, forgot about that evo bug :p
The list is hard coded in itemlislight.class.php ( and it should be $posttypes_locked_IDs )
¥
tried that too, still no change.
8 yabba Jun 24, 2010 16:26
Hmmm, wonder if there was more than one bug then, because that works in my software of choice ;)
¥
9 ckm Oct 14, 2010 05:37
I'm using b2evo 3.3.3 and wanted to do something similar: not include a particular post type (called "sidebar post") in the normal post display.
I ended up hacking the core file inc/items/model/_item.funcs.php and defining my own default filters in the init_MainList() function:
if( $disp == 'page' )
{ // Get pages:
$MainList->set_default_filters( array(
'types' => '1000', // pages
// 'types' => '1000,1500,1520,1530,1570', // pages and intros (intros should normally never be called)
) );
}
// else: we are either in single or in posts mode
// 2010/10/13 - ckm - have to specify which post types to
// ckm - display. I don't want "sidebar posts" displaying
// ckm - in the main area, so they are not included
$MainList->set_default_filters(array( 'types' => '1,1000,2000' ));
I recognize this is a complete hack and will likely lose this change upon upgrade. I tried the $posttype_reserved_IDs recommended above (as well as $posttypte_locked_IDs), but it did not work for me. The comment in item_types.ctrl.php says "// Prevent editing of reserved and locked post types", so it does not seem like this is the right method of preventing these post types from being displayed on the blog, unless this variable is used for other purposes.
Top of your index_main.php
¥