Solved

add to sidebar

Posted on 2014-04-20
6
141 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
This video teaches users how to migrate an existing Wordpress website to a new domain.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

756 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