Solved

add to sidebar

Posted on 2014-04-20
6
142 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

739 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