Help with setting Default Category
Posted: Tue Feb 14, 2006 10:54 am
I installed serendipity 1.0-beta1 and added 2 categories. I would like to default to showing only entries of the 1st category if none are selected (i.e. when first arriving at the blog).
I tried adding the following to index.php:
The entries are displayed correctly but the CSS file no longer is retreived. I cannot figure out why!
I then restored index.php and created an event plugin : default_category with a hook to frontend_configure with this code:
The entries of the first category are displayed correctly but the CSS doesn't work any more.
Any ideas? I've searched this forum and have been fooling with it for hours. Hopefully is just something simple?
Thanks
I tried adding the following to index.php:
Code: Select all
if ( !( preg_match(PAT_PERMALINK_CATEGORIES, $uri)
|| (isset($serendipity['POST']['isMultiCat']) && is_array($serendipity['POST']['multiCat'])))
) {
$serendipity['POST']['multiCat'] = array(1);
$serendipity['POST']['isMultiCat'] = true;
}I then restored index.php and created an event plugin : default_category with a hook to frontend_configure with this code:
Code: Select all
if (! preg_match(PAT_PERMALINK_CATEGORIES, $_SERVER['REQUEST_URI'])) {
$serendipity['POST']['multiCat'] = array(1);
$serendipity['POST']['isMultiCat'] = true;
}
Any ideas? I've searched this forum and have been fooling with it for hours. Hopefully is just something simple?
Thanks