index.phpand let b2evolution do the job of figuring out which collection needs to be displayed.
For example you could create a stub file called
myblog.php at the root of your website so that your blog could be accessed at
http://www.mydomain.com/myblog.php. The main function of the stub file would be to set the collection ID by something like
$blog = 3;.
- Older versions of b2evolution ship with files named
blog7.phpin the root directory.
- Newer versions of b2evolution don’t ship with stub files any more. They are configured by default to recognize all collections as extra-parameters on
You can download a sample stub file from this page or you can copy/paste the sample provided below. Rename it to whatever you want and make sure the extension is
.php once you upload it to your website. (not
.php.txt which is only to make download and editing convenient.)
Exemple of contents of a stub file:
<?php /** * This is a stub file for displaying a b2evolution blog. * * A stub file is used to anchor a particular blog in a particular location of your website. */ # First, select which blog you want to display here! # You can find these numbers in the back-office under the Blogs section. # You can also create new blogs over there. If you do, you may duplicate this file for the new blog. $blog = 2; # You could *force* a specific skin here with this setting: (otherwise, default will be used) # $skin = 'custom'; # This setting retricts posts to those published, thus hiding drafts. # You should not have to change this. $show_statuses = array(); # Additionnaly, you can set other values (see URL params in the manual)... # $order = 'ASC'; // This for example would display the blog in chronological order... /** * That's it, now let b2evolution do the rest! :) * Note: if you put this file in a subdirectory, you will need to adjust the path below, for example: * require_once dirname(__FILE__).'/../conf/_config.php'; */ require_once dirname(__FILE__).'/conf/_config.php'; require $inc_path.'_blog_main.inc.php'; ?>
If you want more information about stub files, please read: Introduction to Stub Files
Created by • Last edit by on Jan 10, 2020