- b2evolution CMS Support Forums
- b2evolution Support
- General Support
- [1.10.x] How to edit a_noskin.php to show only newest post ?
1 skagenmedia Dec 12, 2007 13:13
My b2evolution Version: 1.10.x
I would like to make a modification to a_noskin.php so that it wil only show the newest post AND show all comments at the same time.
The sollution must be within this code, but where ?
<?php // ------------------------------------ START OF POSTS ----------------------------------------
if( isset($MainList) ) $MainList->display_if_empty( '' ); // Display message if no post
if( isset($MainList) ) while( $Item = & $MainList->get_item() )
{
$MainList->date_if_changed( '<h2>', '</h2>', '' );
?>
<div class="bPost" lang="<?php $Item->lang() ?>">
<?php $Item->anchor(); ?>
<div class="bSmallHead">
<?php $Item->permanent_link( '#icon#', '#', '' ); ?>
<?php $Item->issue_time( '' ); echo ', ', T_('Categories'), ': ';
$Item->categories( '#', '<strong>', '</strong>', '', '', '<em>', '</em>', ', ' );
?>
</div>
<h3 class="bTitle"><?php $Item->title( '', '', true ); ?></h3>
<div class="bText">
<?php $Item->content(); ?>
<?php link_pages( '#', '#', 'number', '#', '#', '%d' ) ?>
</div>
<div class="bSmallPrint">
<?php $Item->feedback_link( 'comments', '', ' • ' ) // Link to comments ?>
<?php $Item->feedback_link( 'trackbacks', '', ' • ' ) // Link to trackbacks ?>
<?php $Item->feedback_link( 'pingbacks', '', ' • ' ) // Link to trackbacks ?>
<?php $Item->trackback_rdf() // trackback autodiscovery information ?>
<?php $Item->permanent_link(); ?>
</div>
<?php // ---------------- START OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. ----------------
$disp_comments = 1; // Display the comments if requested
$disp_comment_form = 1; // Display the comments form if comments requested
$disp_trackbacks = 1; // Display the trackbacks if requested
$disp_trackback_url = 1; // Display the trackbal URL if trackbacks requested
$disp_pingbacks = 1; // Display the pingbacks if requested
require( $skins_path.'_feedback.php');
// ------------------- END OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. ------------------- ?>
</div>
<?php } // ---------------------------------- END OF POSTS ------------------------------------ ?>
Have you tried changing your number of posts per page in the back office to 1? (Sorry but I can't tell you the path to that setting because my 1.10.3 installation is dead :( )
If that works but you get a limit of 1 post on pages that you want multiple posts you can probably edit the file you pasted here to force the number of posts with this:
BTW there is no need to paste an entire file here. Most of those of us who answer pretty much either have the file or know where to get it if not.
Anyway I hope this helps because as I mentioned I don't have any experience using the noskin file.
Good luck!