Solved

add to sidebar

Posted on 2014-04-20
6
143 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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!

 

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses

628 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