Solved

add to sidebar

Posted on 2014-04-20
6
137 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
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 update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

705 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now