How to properly create an HTML Sitemap in Osclass (Delta theme)
Step 1. Create the template file Navigate to your theme directory on your hosting. Go to folder , then , then . Create a new file there and name it . Insert the following code into it
c-contentthemesdeltatemplate-html-sitemap.php
PHP
<?php
/*
Template Name: HTML Sitemap
*/
?>
<?php osc_current_web_theme_path('header.php'); ?>
<section class="content sitemap-page loc-page">
<div class="inside">
<h1><?php echo osc_static_page_title(); ?></h1>
<div class="sitemap-wrap" style="display: flex; flex-wrap: wrap; gap: 20px; margin-top: 20px;">
<?php
osc_goto_first_category();
while(osc_has_categories()) { ?>
<div class="sitemap-col" style="flex: 1 1 250px; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid #eee;">
<h3 style="margin-top:0; font-size: 18px; border-bottom: 2px solid <?php echo del_param('color1'); ?>; padding-bottom: 10px; margin-bottom: 15px;">
<a href="<?php echo osc_search_category_url(); ?>" style="color: #333; text-decoration: none;">
<?php echo osc_category_name(); ?>
</a>
<span style="color:#999; font-size:14px; font-weight: normal;">(<?php echo osc_category_total_items(); ?>)</span>
</h3>
<?php if(osc_count_subcategories() > 0) { ?>
<ul style="list-style: none; padding-left: 0; margin: 0;">
<?php while(osc_has_subcategories()) { ?>
<li style="margin-bottom: 8px;">
<a href="<?php echo osc_search_category_url(); ?>" style="color: #666; text-decoration: none; transition: 0.2s;">
— <?php echo osc_category_name(); ?>
</a>
</li>
<?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
</section>
<?php osc_current_web_theme_path('footer.php'); ?>
Step 2. Page setup in the admin panel
if (osc_static_page_slug() == 'sitemap') {
osc_current_web_theme_path('template-html-sitemap.php');
exit;
}
How it works: Now, when a visitor or a search engine bot tries to open your Sitemap page, the engine will check its internal name. Seeing the word sitemap, the system will instantly load your beautiful new file with the category grid and stop loading the standard empty sheet (the exit command is responsible for exactly this).
Forgot to specify the file name - template-html-sitemap.php
Step 1. Create the template file Navigate to your theme directory on your hosting. Go to folder , then , then . Create a new file there and name it . Insert the following code into it
PHP
<?php
/*
Template Name: HTML Sitemap
*/
?>
<?php osc_current_web_theme_path('header.php'); ?>
<section class="content sitemap-page loc-page">
<div class="inside">
<h1><?php echo osc_static_page_title(); ?></h1>
<div class="sitemap-wrap" style="display: flex; flex-wrap: wrap; gap: 20px; margin-top: 20px;">
<?php
osc_goto_first_category();
while(osc_has_categories()) { ?>
<div class="sitemap-col" style="flex: 1 1 250px; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid #eee;">
<h3 style="margin-top:0; font-size: 18px; border-bottom: 2px solid <?php echo del_param('color1'); ?>; padding-bottom: 10px; margin-bottom: 15px;">
<a href="<?php echo osc_search_category_url(); ?>" style="color: #333; text-decoration: none;">
<?php echo osc_category_name(); ?>
</a>
<span style="color:#999; font-size:14px; font-weight: normal;">(<?php echo osc_category_total_items(); ?>)</span>
</h3>
<?php if(osc_count_subcategories() > 0) { ?>
<ul style="list-style: none; padding-left: 0; margin: 0;">
<?php while(osc_has_subcategories()) { ?>
<li style="margin-bottom: 8px;">
<a href="<?php echo osc_search_category_url(); ?>" style="color: #666; text-decoration: none; transition: 0.2s;">
— <?php echo osc_category_name(); ?>
</a>
</li>
<?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
</section>
<?php osc_current_web_theme_path('footer.php'); ?>
Step 2. Page setup in the admin panel
- Log in to the Osclass admin panel.
- Go to the Pages section, click Add new.
- In the Title field, write: Sitemap.
- In the Internal name field, you must strictly write the word (in lowercase English letters, no spaces).sitemap
- Save the page.
- On your hosting, go back to your theme folder.delta
- Find the system file and open it for editing.page.php
- At the very beginning of the file, right below the opening PHP tag, insert this interceptor code:
if (osc_static_page_slug() == 'sitemap') {
osc_current_web_theme_path('template-html-sitemap.php');
exit;
}
How it works: Now, when a visitor or a search engine bot tries to open your Sitemap page, the engine will check its internal name. Seeing the word sitemap, the system will instantly load your beautiful new file with the category grid and stop loading the standard empty sheet (the exit command is responsible for exactly this).
Post automatically merged:
Forgot to specify the file name - template-html-sitemap.php
Last edited: