Where to insert ad code in CSS?
-
- Joomla! Apprentice
- Posts: 17
- Joined: Sat Jul 14, 2012 6:57 pm
Where to insert ad code in CSS?
My advertising partner requires that I insert this ad code under the title of my web site, sports-at-work.com. I know double-click isn't the best, but I don't rely on the front page for revenue and this partner helps increase traffic to my site substantially.
Can someone please tell me specifically where to insert the code in CSS? Thanks in advance for any help! -Luke
Extensions
Template Manager
gk_icki_sports
Edit CSS
...and then where after that?
<!-- begin 728x90 Top Sports-at-work -->
<script language="JavaScript" type="text/javascript">
window.dctile = Number(window.dctile) + 1 || 1;
window.dc_ord = Number(window.dc_ord) || Math.floor(Math.random() * 1E10);
if (dctile==1) {var vdcopt = 'ist';} else {vdcopt = '';}
if (17>dctile) document.write('<script type="text/javascript" src="http://ad.doubleclick.net/adj/yb.sports ... =pg;dcopt=' + vdcopt + ';yb=ad;s1=;s2=;tile=' + dctile + ';sz=728x90;ord=' + dc_ord + '?"><\/script>\n');
</script>
<!-- End ad tag -->
Can someone please tell me specifically where to insert the code in CSS? Thanks in advance for any help! -Luke
Extensions
Template Manager
gk_icki_sports
Edit CSS
...and then where after that?
<!-- begin 728x90 Top Sports-at-work -->
<script language="JavaScript" type="text/javascript">
window.dctile = Number(window.dctile) + 1 || 1;
window.dc_ord = Number(window.dc_ord) || Math.floor(Math.random() * 1E10);
if (dctile==1) {var vdcopt = 'ist';} else {vdcopt = '';}
if (17>dctile) document.write('<script type="text/javascript" src="http://ad.doubleclick.net/adj/yb.sports ... =pg;dcopt=' + vdcopt + ';yb=ad;s1=;s2=;tile=' + dctile + ';sz=728x90;ord=' + dc_ord + '?"><\/script>\n');
</script>
<!-- End ad tag -->
-
- Joomla! Enthusiast
- Posts: 100
- Joined: Sun Jun 14, 2009 12:43 am
- Contact:
Re: Where to insert ad code in CSS?
That code is not CSS, but you can place that in you index.php file for each theme that you are using.
http://westernstudios.net - Joomla Tutorials, components, services
http://westernstudios.net/product/ws-jo ... bscription - Joomla Subscription Component
http://westernstudios.net/product/ws-jo ... bscription - Joomla Subscription Component
-
- Joomla! Apprentice
- Posts: 17
- Joined: Sat Jul 14, 2012 6:57 pm
Re: Where to insert ad code in CSS?
Where exactly do I go to place that code? (i.e. where do I find the correct index.php file)
Sorry if this is a basic question, but this is my first time doing anything like this. I took over the site somewhat recently and am learning on the fly.
As I mentioned, the theme I'm using is gk_icki_sports.
Thanks for your help!
Sorry if this is a basic question, but this is my first time doing anything like this. I took over the site somewhat recently and am learning on the fly.
As I mentioned, the theme I'm using is gk_icki_sports.
Thanks for your help!
-
- Joomla! Enthusiast
- Posts: 100
- Joined: Sun Jun 14, 2009 12:43 am
- Contact:
Re: Where to insert ad code in CSS?
I do understand You can find that file in templates/gk_icki_sports/index.php
Search for </head> and place those codes just above it like in the example
Search for </head> and place those codes just above it like in the example
Code: Select all
<!-- begin 728x90 Top Sports-at-work -->
<script language="JavaScript" type="text/javascript">
window.dctile = Number(window.dctile) + 1 || 1;
window.dc_ord = Number(window.dc_ord) || Math.floor(Math.random() * 1E10);
if (dctile==1) {var vdcopt = 'ist';} else {vdcopt = '';}
if (17>dctile) document.write('<script type="text/javascript" src="http://ad.doubleclick.net/adj/yb.sportsatwork/;chan1=gensports;rating=pg;dcopt=' + vdcopt + ';yb=ad;s1=;s2=;tile=' + dctile + ';sz=728x90;ord=' + dc_ord + '?"><\/script>\n');
</script>
<!-- End ad tag -->
</head>
http://westernstudios.net - Joomla Tutorials, components, services
http://westernstudios.net/product/ws-jo ... bscription - Joomla Subscription Component
http://westernstudios.net/product/ws-jo ... bscription - Joomla Subscription Component
-
- Joomla! Apprentice
- Posts: 17
- Joined: Sat Jul 14, 2012 6:57 pm
Re: Where to insert ad code in CSS?
Thanks, ws! That worked. However, I'd like it to be centered instead of aligned left. Any idea how to do that?
-
- Joomla! Enthusiast
- Posts: 100
- Joined: Sun Jun 14, 2009 12:43 am
- Contact:
Re: Where to insert ad code in CSS?
You may be able to center it by using the <center></center> tags. In this case though you will need to move the codes to the body tag.
You would instead find the <body> tag and below that add the codes so it would look like the following
You could use other means to center such as css styles or the ads code may offer a way to center.
You would instead find the <body> tag and below that add the codes so it would look like the following
Code: Select all
<body>
<center>
<!-- begin 728x90 Top Sports-at-work -->
<script language="JavaScript" type="text/javascript">
window.dctile = Number(window.dctile) + 1 || 1;
window.dc_ord = Number(window.dc_ord) || Math.floor(Math.random() * 1E10);
if (dctile==1) {var vdcopt = 'ist';} else {vdcopt = '';}
if (17>dctile) document.write('<script type="text/javascript" src="http://ad.doubleclick.net/adj/yb.sportsatwork/;chan1=gensports;rating=pg;dcopt=' + vdcopt + ';yb=ad;s1=;s2=;tile=' + dctile + ';sz=728x90;ord=' + dc_ord + '?"><\/script>\n');
</script>
<!-- End ad tag -->
</center>
http://westernstudios.net - Joomla Tutorials, components, services
http://westernstudios.net/product/ws-jo ... bscription - Joomla Subscription Component
http://westernstudios.net/product/ws-jo ... bscription - Joomla Subscription Component
-
- Joomla! Apprentice
- Posts: 17
- Joined: Sat Jul 14, 2012 6:57 pm
Re: Where to insert ad code in CSS?
Awesome, that did the trick. Thanks for your help!
-
- Joomla! Apprentice
- Posts: 17
- Joined: Sat Jul 14, 2012 6:57 pm
Re: Where to insert ad code in CSS?
I have one last question. How can I make the ad appear only on the front page? I don't want it to appear on all article pages.
Thanks!
Thanks!
-
- Joomla! Enthusiast
- Posts: 100
- Joined: Sun Jun 14, 2009 12:43 am
- Contact:
Re: Where to insert ad code in CSS?
Replace the codes above with the following should do what you need.
Code: Select all
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault()) {
?>
<center>
<!-- begin 728x90 Top Sports-at-work -->
<script language="JavaScript" type="text/javascript">
window.dctile = Number(window.dctile) + 1 || 1;
window.dc_ord = Number(window.dc_ord) || Math.floor(Math.random() * 1E10);
if (dctile==1) {var vdcopt = 'ist';} else {vdcopt = '';}
if (17>dctile) document.write('<script type="text/javascript" src="http://ad.doubleclick.net/adj/yb.sportsatwork/;chan1=gensports;rating=pg;dcopt=' + vdcopt + ';yb=ad;s1=;s2=;tile=' + dctile + ';sz=728x90;ord=' + dc_ord + '?"><\/script>\n');
</script>
<!-- End ad tag -->
</center>
<?php
}
?>
http://westernstudios.net - Joomla Tutorials, components, services
http://westernstudios.net/product/ws-jo ... bscription - Joomla Subscription Component
http://westernstudios.net/product/ws-jo ... bscription - Joomla Subscription Component
-
- Joomla! Apprentice
- Posts: 17
- Joined: Sat Jul 14, 2012 6:57 pm
Re: Where to insert ad code in CSS?
Great, thanks for all the help--I'm impressed!