Tagged: sidebar
- This topic has 9 replies, 2 voices, and was last updated 10 years, 2 months ago by Sakin.
-
AuthorPosts
-
June 19, 2014 at 2:30 pm #35382MichaelaParticipant
Hi,
I would like to include advertisements in my right sidebar.
1. How do I do include Google Ads?
2. How do I change the size of the right sidebar, so that it adjusts to the size of the ad, which should be 160px wide (therefore the main content on the left would get more space)
3. What should I do if on some pages I don’t want a Google Ad in the right sidebar, but a different ad from an affiliate partner?
Thanks!June 19, 2014 at 11:27 pm #35444SakinKeymasterHi Michaela,
Looks like you need to upgrade to Pro version.
1. Then you can use “2. Catch Kathmandu: Advertisement” widget and add your Google Ads code in Header Right Sidebar.
2. For this you can add the following css in “Appearance => Theme Options => Custom CSS” box.
#primary { width: 900px; } #secondary { width: 240px; } @media screen and (max-width: 1344px) { #primary { width: 840px; } } @media screen and (max-width: 1280px) { #primary { width: 770px; } #secondary { width: 220px; } } @media screen and (max-width: 1152px) { #primary { width: 690px; } #secondary { width: 200px; } } @media screen and (max-width: 1024px) { #primary { width: 630px; } #secondary { width: 200px; } } @media screen and (max-width: 960px) { #primary, #secondary { width: 100%; } }
3. You have option to use Page Sidebar and further choose Optional sidebar one, Optional sidebar two and optional sidebar three. So, depending on the pages, you can choose the sidebar to display. You can add different ads widgets in different sidebar. If you want for options, then you can activate “Jetpack” plugin “Widget Visibility” module and then add widget with visibility condition.
Regards,
SakinJune 20, 2014 at 3:47 am #35495MichaelaParticipantHi Sakin,
great, thanks a lot for the info.
Just to verify answer 2): you really don’t want to define the width of the “#secondary” in a screen width of 1344px, as it’s not listed in the CSS code you gave?:
@media screen and (max-width: 1344px) {
#primary { width: 840px; }
}Where can I choose the optional sidebars you mentioned in 3)?
Thanks,
MichaelaJune 20, 2014 at 12:10 pm #35560SakinKeymasterHi Michaela,
Yes because the above #secondary { width: 240px; } will work for you. As in when you define width 240px, you will get 160px of width in your sidebar. If you want then you can add that’s not a problem. But it’s just repeating and it will be as below:
#primary { width: 900px; } #secondary { width: 240px; } @media screen and (max-width: 1344px) { #primary { width: 840px; } #secondary { width: 240px; } } @media screen and (max-width: 1280px) { #primary { width: 770px; } #secondary { width: 220px; } } @media screen and (max-width: 1152px) { #primary { width: 690px; } #secondary { width: 200px; } } @media screen and (max-width: 1024px) { #primary { width: 630px; } #secondary { width: 200px; } } @media screen and (max-width: 960px) { #primary, #secondary { width: 100%; } }
Sorry, this optional sidebar option is there only in Pro version. See more additional features in Pro version at http://catchthemes.com/theme-instructions/catch-kathmandu-pro/
September 15, 2014 at 9:35 pm #43906MichaelaParticipantHi Sakin,
the long code you gave me above for making the right sidebar smaller worked fine for 2 months, until a few days ago. Do you know what could have happened? I did not make any changes, but now the right sidebar on my website (e.g. http://travelintense.com/equipment/camping-gear/stove/) is way too wide. It should just be wide enough to accomodate adds that are 160px wide.
Thanks a lot for your help!
P.S.: Please delete any of my weblinks to my site after you read it.
September 15, 2014 at 11:26 pm #43912SakinKeymaster@Michaela: I don’t see any issue in your site. You site still have 240px width sidebar. This width is needed as sidebar have padding of 40px left and right. So, the width left for ads in 160px.
September 16, 2014 at 12:56 am #43923MichaelaParticipantHi Sakin,
this is weird. I work on a netbook with a screen width of 1024px. And my sidebar is definitely wider than 204px. When I use the Firefox plugin “Pixelzoomer” to measure the size of the sidebar, it gives me a value of 340px (=20px padding left, 300px content, 20px padding right). This is way too big for me, as the rest width for my real content on the left is only 480px (550px – 30px padding left – 40px padding right).
I would like to have the following set up:
– padding for each of the sidebar elements: 10px all around
– margin between sidebar elements: 20px
– sidebar element content width: 160px (no matter which computer screen size)
– main content on the left side should always be as wide as possible (total screen size -160px -twice 10pxHow can I do this?
Thanks a lot for your help and best regards,
MichaelaSeptember 17, 2014 at 12:27 am #43952SakinKeymasterHi Michaela,
It was not working as you were adding css in your child theme style.css and not in Custom CSS box.
If you are using it in child theme style.css then you need to have priority. So, I have added
#main
before. See this#main #primary { width: 900px; } #main #secondary { width: 240px; } @media screen and (max-width: 1344px) { #main #primary { width: 840px; } #main #secondary { width: 240px; } } @media screen and (max-width: 1280px) { #main #primary { width: 770px; } #main #secondary { width: 220px; } } @media screen and (max-width: 1152px) { #main #primary { width: 690px; } #main #secondary { width: 200px; } } @media screen and (max-width: 1024px) { #main #primary { width: 630px; } #main #secondary { width: 200px; } } @media screen and (max-width: 960px) { #main #primary, #main #secondary { width: 100%; } }
Regards,
SakinSeptember 17, 2014 at 1:03 am #43954MichaelaParticipantBeautiful. That works. Thank you so much.
So just for my better understanding: when do I need to add this #main thing? Because all my other stuff works when I had put it from the Custom CSS to the child stylesheet? (I did so as it reduces loading time)September 17, 2014 at 6:25 pm #43984 -
AuthorPosts
- The topic ‘Google Ads customization’ is closed to new replies.