Osclass forums
		Support forums => General help => Topic started by: Rupert on July 02, 2019, 01:04:46 am
		
			
			- 
				Hello all,
I am using Bender theme, and am trying to figure out how to modify specific categories. The only modifications I want to make are to add specific text at the top of the category page. Each category will have different text. So, the mods aren't drastic.
I was able to find this older thread:
https://forums.osclass.org/3-5-x/different-template-for-certain-categories/
that I think has the answer I am looking for. However, I keep doing something wrong. Has anyone else done this, and can you tell me where to put the custom code (as given at the link I referenced above).
Thank you.
			 
			
			- 
				
Hello all,
I am using Bender theme, and am trying to figure out how to modify specific categories. The only modifications I want to make are to add specific text at the top of the category page. Each category will have different text. So, the mods aren't drastic.
I was able to find this older thread:
https://forums.osclass.org/3-5-x/different-template-for-certain-categories/
that I think has the answer I am looking for. However, I keep doing something wrong. Has anyone else done this, and can you tell me where to put the custom code (as given at the link I referenced above).
Thank you.
If I understood your requirement correctly, paste the code below in the 'header.php' in appropriate place and change the style as needed.
        <?php if (osc_is_search_page()) { ?>
         <div style="text-align:center; height:40px; background:#900; color:#FFF; font-weight:bold; padding-top:8px">
       		<?php if (!search_title() ) { ?><?php _e('Search Results','bender'); ?> <?php } elseif ( osc_category_description()) { ?><?php echo osc_category_description(); ?></div><?php } else { ?><?php echo search_title(); ?>
			<?php } ?> 
         </div> 
	   <?php } ?>   
Hope this helps!
Regards
			 
			
			- 
				Very grateful for the answer! I'll give it a try very soon.
			
 
			
			- 
				Hello,
BritWeb, thank you for the code and it worked perfectly. However, I stated my question poorly because the answer isn't what I'm searching for.
What I'm looking for is a way to have a paragraph or so of text below the category heading on each category's main page. For example:
<h1>Name Of Category</h1>
<p>Specific text for this particular category. Specific text for this particular category. Specific text for this particular category. Specific text for this particular category.</p>
<h2>Premium Listings</p>
...listings here...
<h2>All Listings</p>
...listings here...
i've also attached a screenshot if that helps.
I am converting an existing classifieds site over to Osclass. The text I would like to insert is helping the existing site rank very well for several categories. If I don't have the text those pages will fall drastically in search engine rankings (I've tested it in the past...the text makes a big difference).
Thanks for any help you can provide.
			 
			
			- 
				In that case you could do the following:
on 'search.php' find the following lines...
<?php osc_current_web_theme_path('header.php') ; ?>
     <div class="list-header">
        <div class="resp-wrapper">
            <?php osc_run_hook('search_ads_listing_top'); ?>
            <h1><?php echo search_title(); ?></h1>
...and add  '<p><?php echo osc_category_description(); ?></p>' to it so that it now looks as below:
<?php osc_current_web_theme_path('header.php') ; ?>
     <div class="list-header">
        <div class="resp-wrapper">
            <?php osc_run_hook('search_ads_listing_top'); ?>
            <h1><?php echo search_title(); ?></h1>
<p><?php echo osc_category_description(); ?></p>
Please make sure you add appropriate description for every category you have created.
Best of luck!
			 
			
			- 
				Thanks! I will check this out soon. I need to add a SEO plugin to set the description meta tags, but I can't do that until I migrate from my test server to the actual server. I do appreciate all your help.
			
 
			
			- 
				BritWeb, sorry for the belated reply. Your solution works terrific!
I appreciate your help very much.
			 
			
			- 
				
BritWeb, sorry for the belated reply. Your solution works terrific!
I appreciate your help very much.
You are welcome!