Author Topic: Latest listing Display in a separate custom page  (Read 502 times)


  • Newbie
  • *
  • Posts: 15
Latest listing Display in a separate custom page
« on: March 01, 2017, 02:02:03 pm »
Hi everyone,

I am new theme developer in osclass.

I want to know how to display all latest listing in a separate custom page and link that page somewhere say header or footer area..

Currently in bender theme latest listing is showing in homepage and all codes are placed in main.php.

is it possible to display latest listing in a custom page and link that in header or footer area..?

This is my first post in this forum. I beg everyone's pardon if i made any mistake...

Need help!!


  • Newbie
  • *
  • Posts: 24
Re: Latest listing Display in a separate custom page
« Reply #1 on: March 09, 2017, 08:05:34 pm »
- create a php file with this code below, and give a name with template-
eg: template-mycustompage.php or template-abcdef.php
code :
Code: [Select]
     *      Osclass – software for creating and publishing online classified
     *                           advertising platforms
     *                        Copyright (C) 2014 OSCLASS
     *       This program is free software: you can redistribute it and/or
     *     modify it under the terms of the GNU Affero General Public License
     *     as published by the Free Software Foundation, either version 3 of
     *            the License, or (at your option) any later version.
     *     This program is distributed in the hope that it will be useful, but
     *         WITHOUT ANY WARRANTY; without even the implied warranty of
     *             GNU Affero General Public License for more details.
     *      You should have received a copy of the GNU Affero General Public
     * License along with this program.  If not, see <http://www.gnu.org/licenses/>.

    // meta tag robots

$buttonClass '';
$listClass   '';
bender_show_as() == 'gallery'){
$listClass 'listing-grid';
$buttonClass 'active';

<?php osc_current_web_theme_path('header.php') ; ?>
<div class="clear"></div>
<div class="latest_ads">
<h1><strong><?php _e('Latest Listings''bender') ; ?></strong></h1>
 <?php if( osc_count_latest_items() == 0) { ?>
    <div class="clear"></div>
    <p class="empty"><?php _e("There aren't listings available at this moment"'bender'); ?></p>
<?php } else { ?>

    <div class="clear"></div>
    <?php if( osc_count_latest_items() == osc_max_latest_items() ) { ?>
        <p class="see_more_link"><a href="<?php echo osc_search_url() ; ?>">
            <strong><?php _e('See all listings''bender') ; ?> &raquo;</strong></a>
    <?php ?>
<?php ?>
</div><!-- main -->
<div class="clear"><!-- do not close, use main clossing tag for this case -->
<?php if( osc_get_preference('homepage-728x90''bender') != '') { ?>
<!-- homepage ad 728x60-->
<div class="ads_728">
    <?php echo osc_get_preference('homepage-728x90''bender'); ?>
<!-- /homepage ad 728x60-->
<?php ?>
<?php osc_current_web_theme_path('footer.php') ; ?>

- put that php file in to bender theme folder.
- from osclass admin create new page, fill Title,Internal name for your page
select your page php from dropdown under Page template.
let Description empty.
and tick Show a link in footer. than click add page.

sorry for my english i use translator
thanks much..
« Last Edit: March 09, 2017, 08:09:29 pm by jhosua »