Solved

add to sidebar

Posted on 2014-04-20
6
139 Views
Last Modified: 2014-05-03
Hi

I am using twentyfourteen theme.

How do i

1) insert a advertisement with image in the left side bard under the links?


http://mymrt.net/wordpress/

I have a child css that works and I know enough css to make things work.
0
Comment
Question by:jagguy
  • 3
  • 3
6 Comments
 
LVL 15

Expert Comment

by:eemit
ID: 40012930
You can use the Plugin: Quick Adsense

Or you can use a Text Widget.
Add this to a text Widget:
Replace src url with url of your image.
Replace a href with your url.
Adjust also width and height with width and height of your image in pixels.

<div class="advertisement-widget">
	<a href="http://mymrt.net/wordpress/" target="_blank" >
	<img src="http://mymrt.net/wordpress/wp-content/uploads/2014/04/yourimage.jpg"  alt="Your Alt text here" width="162" height="200" /></a>
</div>

Open in new window

Add this to your Style.css:
.advertisement-widget a {
	background: none;
}

.advertisement-widget img {
	border: 0;
}

Open in new window

0
 

Author Comment

by:jagguy
ID: 40014493
Hi,

is there a way to add it without a widget or is this too difficult
0
 
LVL 15

Expert Comment

by:eemit
ID: 40014712
Yes, copy sidebar.php to your child theme's folder and insert that code above the line:
<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:jagguy
ID: 40017301
ok I will look at it
0
 

Author Comment

by:jagguy
ID: 40024070
Hi,

I place sidebar.php in child theme and how do I edit this because I dont know if editor picks up the child or the original file as only sidebar.php is listed once?



Do I add code via just a div or do I need to add it i a php tag?
I can see it isnt difficult but I dont want to add code and do things the hard way.

      <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
      <div id="primary-sidebar" class="primary-sidebar widget-area" role="complementary">
            <?php dynamic_sidebar( 'sidebar-1' ); ?>
      </div><!-- #primary-sidebar -->
      <?php endif; ?>
</div><!-- #secondary -->
0
 
LVL 15

Accepted Solution

by:
eemit earned 500 total points
ID: 40024370
I place sidebar.php in child theme and how do I edit this because I dont know if editor picks up the child or the original file as only sidebar.php is listed once?
Go to Appearance/Editor/
Select Theme to edit:
Choose your child theme and press the Button Select.

You must not use theme's editor. You can also first make changes in sidebar.php locally using a text editor like notepad++ and then upload it to your site using FTP.

Do I add code via just a div or do I need to add it i a php tag?
You don't need to enclose it in php tag because in code above there is no PHP code.

I can see it isnt difficult but I dont want to add code and do things the hard way.
You can choose one of the other two solutions i have posted.
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question