Advertisement:

Author Topic: How to post HTML code or ads on sidebars ?  (Read 4765 times)

ColdWabmaster

  • Full Member
  • ***
  • Posts: 151
How to post HTML code or ads on sidebars ?
« on: September 10, 2014, 01:12:58 pm »
I have installed modern theme and I like to have a sidebar widget that appears like the location widget as shown in the snapshot. Is there any way I can achieve that ?  ???

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: How to post HTML code or ads on sidebars ?
« Reply #1 on: September 10, 2014, 02:33:56 pm »
There are a couple ways to do this. I prefer to just create a widget.
In modern theme index.php file add:
Code: [Select]

 <?php
/*
Theme Name: modern
Theme URI:
Description: modern
Version: 
Author:
Author URI:
Widgets: header,footer,sidebar,
Theme update URI: 
*/
    
function modern_theme_info() {
        return array(
             
'name'        => 'modern'
            
,'version'     => ''
            
,'description' => 'modern'
            
,'author_name' => ''
            
,'author_url'  => ''
            
,'locations'   => array('header','sidebar','footer')
        );
    }
?>



Then place <?php osc_show_widgets('sidebar') ; ?> into the theme main.php at sidebar code wherever you want it to appear. Your image suggests you want to place it at the end of the locations code.

Then go to admin, widgets and create your widget using whatever code (html, php) you want.
 
Tom
« Last Edit: September 15, 2014, 05:42:08 pm by tomshaft »

ColdWabmaster

  • Full Member
  • ***
  • Posts: 151
Re: How to post HTML code or ads on sidebars ?
« Reply #2 on: September 10, 2014, 03:48:39 pm »
I didn't got any sidebar widget in widget panel... please suggest something effective !!

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: How to post HTML code or ads on sidebars ?
« Reply #3 on: September 10, 2014, 06:53:02 pm »
This is effective if followed correctly.
 
Perhaps someone else has a better suggestion for you.

Tom

ColdWabmaster

  • Full Member
  • ***
  • Posts: 151
Re: How to post HTML code or ads on sidebars ?
« Reply #4 on: September 10, 2014, 07:09:12 pm »
I have done all things you have listed above but it is bringing no effect there no such sidebar widget appearing ??

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: How to post HTML code or ads on sidebars ?
« Reply #5 on: September 10, 2014, 07:18:24 pm »
Attached are screenshots of index.php, main.php and what the admin, widget looks like.
The images are from the bcute theme but I have also done this to the modern theme with no issues.
 
Do it as shown in the images.

Tom

ColdWabmaster

  • Full Member
  • ***
  • Posts: 151
Re: How to post HTML code or ads on sidebars ?
« Reply #6 on: September 10, 2014, 07:45:44 pm »
I did exactly the same but the sidebar widget is not appearing what is the reason  ???

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: How to post HTML code or ads on sidebars ?
« Reply #7 on: September 10, 2014, 10:46:25 pm »
Please post screenshots of your index.php, main.php
OR
Post via attached zip these files so that I can try using your files.
 
Thanks
Tom

ColdWabmaster

  • Full Member
  • ***
  • Posts: 151
Re: How to post HTML code or ads on sidebars ?
« Reply #8 on: September 10, 2014, 10:58:38 pm »
Please I have attached my files as edited before take a look at it ..... ???

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: How to post HTML code or ads on sidebars ?
« Reply #9 on: September 11, 2014, 12:01:12 am »
Here you go.
See attached screenshots.
 
Tom

ColdWabmaster

  • Full Member
  • ***
  • Posts: 151
Re: How to post HTML code or ads on sidebars ?
« Reply #10 on: September 11, 2014, 07:36:14 am »
I have copied files to the oc-content/themes/modern ... But there is no front end result. ... What's wrong ?  ???

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: How to post HTML code or ads on sidebars ?
« Reply #11 on: September 15, 2014, 12:49:14 am »
Don't know....
 
Can I assume you were able to create the widget(s) in admin and that you did insert the correct code for the widget into the php file?
 
Have you refreshed the browser page. Make sure your not viewing a cached copy of the page.
 
Can you send a working link to your site?
 
Tom
 
 

ColdWabmaster

  • Full Member
  • ***
  • Posts: 151
Re: How to post HTML code or ads on sidebars ?
« Reply #12 on: September 15, 2014, 08:51:08 am »
Please look at the site and if you need anything else ask here right away .. :)
My URL: http://goo.gl/JNG0Q0
« Last Edit: September 15, 2014, 02:07:06 pm by Sinto001 »

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: How to post HTML code or ads on sidebars ?
« Reply #13 on: September 15, 2014, 01:19:33 pm »
The link appears to lead to a Wordpress coded site?
I find nothing about Osclass, Modern theme or widgets.
 
Sorry I can not help you.
 
Tom

aide2001

  • Guest
Re: How to post HTML code or ads on sidebars ?
« Reply #14 on: September 15, 2014, 01:24:15 pm »
you could always use a plugin i used @ www.bikersbay.co.uk/os/
it can add anything you like to your site (anywhere you put the code)