Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » New Versions, & Updating »

[SOLVED] How to insert code above the loop?


  #1  
Old Jun 2, 2011, 01:26 AM
Harald
 
72 posts · Mar 2010
I had the code below inserted above the loop in Atahualpa 364, but cant get it to work in 367. Tried to insert it into the Index file but I am not good enough to get it to work. Is it possible, and if so could some one show me how?


<style type="text/css">
<!--
#nav{list-style-type:none; width:1026px; height:35px; padding:0px; margin:0px 0 10px 0 auto;}
#nav li{float:left}
#nav li a{background:url(/wp-content/themes/atahualpa/images/navbar2.png) no-repeat; outline:none; display:block; width:128px; height:35px}
#nav li a span{display:none}
#nav li a#iskanorfalsterbo:{background-position:0 0;}
#nav li a#iskanorfalsterbo:hover{background-position:0 -35px;}
#nav li a#iskanorfalsterbo:active{background-position:0 -70px;}
#nav li a#iskanorfalsterbo.on:link,
#nav li a#iskanorfalsterbo.on:hover,
#nav li a#iskanorfalsterbo.on:active,
#nav li a#iskanorfalsterbo.on:visited{background-position:0 -105px;}
#nav li a#affarsliv{background-position:-128px 0;}
#nav li a#affarsliv:hover{background-position:-128px -35px;}
#nav li a#affarsliv:active{background-position:-128px -70px;}
#nav li a#affarsliv.on:link,
#nav li a#affarsliv.on:hover,
#nav li a#affarsliv.on:active,
#nav li a#affarsliv.on:visited{background-position:-128px -105px;}
#nav li a#familjeliv{background-position:-256px 0;}
#nav li a#familjeliv:hover{background-position:-256px -35px;}
#nav li a#familjeliv:active{background-position:-256px -70px;}
#nav li a#familjeliv.on:link,
#nav li a#familjeliv.on:hover,
#nav li a#familjeliv.on:active,
#nav li a#familjeliv.on:visited{background-position:-256px -105px;}
#nav li a#ungdomsliv{background-position:-384px 0;}
#nav li a#ungdomsliv:hover{background-position:-384px -35px;}
#nav li a#ungdomsliv:active{background-position:-384px -70px;}
#nav li a#ungdomsliv.on:link,
#nav li a#ungdomsliv.on:hover,
#nav li a#ungdomsliv.on:active,
#nav li a#ungdomsliv.on:visited{background-position:-384px -105px;}
#nav li a#foreningsliv{background-position:-512px 0;}
#nav li a#foreningsliv:hover{background-position:-512px -35px;}
#nav li a#foreningsliv:active{background-position:-512px -70px;}
#nav li a#foreningsliv.on:link,
#nav li a#foreningsliv.on:hover,
#nav li a#foreningsliv.on:active,
#nav li a#foreningsliv.on:visited{background-position:-512px -105px;}
#nav li a#naturliv{background-position:-640px 0;}
#nav li a#naturliv:hover{background-position:-640px -35px;}
#nav li a#naturliv:active{background-position:-640px -70px;}
#nav li a#naturliv.on:link,
#nav li a#naturliv.on:hover,
#nav li a#naturliv.on:active,
#nav li a#naturliv.on:visited{background-position:-640px -105px;}
#nav li a#evenemang{background-position:-768px 0;}
#nav li a#evenemang:hover{background-position:-768px -35px;}
#nav li a#evenemang:active{background-position:-768px -70px;}
#nav li a#evenemang.on:link,
#nav li a#evenemang.on:hover,
#nav li a#evenemang.on:active,
#nav li a#evenemang.on:visited{background-position:-768px -105px;}
#nav li a#search{background-position:-896px 0;}
#nav li a#search:hover{background-position:-896px -0px;}
#nav li a#search:active{background-position:-896px 0px;}
#nav li a#search.on:link,
#nav li a#search.on:hover,
#nav li a#search.on:active,
-->
</style>
<body>
<ul id="nav">
<li><a id="iskanorfalsterbo" href="http://www.iskanorfalsterbo.se/"><span>iSkanörFalsterbo</span></a></li>
<li><a id="affarsliv" href="http://www.iskanorfalsterbo.se/?page_id=15" <?php if (is_page('Affärsliv')) echo'class="on"'; ?>><span>Affärsliv</span></a></li>
<li><a id="familjeliv" href="http://www.iskanorfalsterbo.se/?page_id=33" <?php if (is_page('Familjeliv')) echo'class="on"'; ?>><span>Familjeliv</span></a></li>
<li><a id="ungdomsliv" href="http://www.iskanorfalsterbo.se/?page_id=36" <?php if (is_page('Ungdomsliv')) echo'class="on"'; ?>><span>Ungdomsliv</span></a></li>
<li><a id="foreningsliv" href="http://www.iskanorfalsterbo.se/?page_id=40" <?php if (is_page('Föreningsliv')) echo'class="on"'; ?>><span>Föreningsliv</span></a></li>
<li><a id="naturliv" href="http://www.iskanorfalsterbo.se/?page_id=47" <?php if (is_page('Naturliv')) echo'class="on"'; ?>><span>Naturliv</span></a></li>
<li><a id="evenemang" href="http://www.iskanorfalsterbo.se/?page_id=49" <?php if (is_page('Events')) echo'class="on"'; ?>><span>Evenemang</span></a></li>
<li><a id="search"><div style="margin: 5px 0px 0px 2px; float:left;">
<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
<input type="text" name="s" id="s" style="color: #FFFFFF; background: transparent; border-left: 1px solid #888888; border-right: 1px solid #888888; border-bottom: 1px solid #888888; border-top: 2px solid #555555; -moz-border-radius: 25px; -khtml-border-radius: 25px; -webkit-border-radius: 25px; border-radius: 25px;" size="14" />
<input type="hidden" id="searchsubmit" />
</form></div></a></li>
</ul>
</body>

Tanks for all help,
Harald
  #2  
Old Jun 2, 2011, 07:11 AM
lmilesw's Avatar
lmilesw
 
10,174 posts · Jul 2009
Central New York State USA
Because of WordPress requirements that php not be executed that section was taken out but there will be a place available in an upcoming release to put "SOME" code but probably not what you have. For the time being you can just use 3.6.4 though.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #3  
Old Jun 2, 2011, 07:58 AM
Harald
 
72 posts · Mar 2010
Quote:
Originally Posted by lmilesw
Because of WordPress requirements that php not be executed that section was taken out but there will be a place available in an upcoming release to put "SOME" code but probably not what you have. For the time being you can just use 3.6.4 though.
I know, but there was a mention to put the code in the index.php file. Are you saying that the code I have can't be added there? I tried and it showed the list (the code is an apple like menu bar), but not the formating so it did not look good. I thought I just inserted it wrong in the file. For the time being I have gone back to 3.6.4.
  #4  
Old Jun 2, 2011, 03:37 PM
lmilesw's Avatar
lmilesw
 
10,174 posts · Jul 2009
Central New York State USA
I never fiddle with editing the theme files so I can't give you an "experienced" answer. Sorry.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #5  
Old Jun 2, 2011, 03:44 PM
Harald
 
72 posts · Mar 2010
Quote:
Originally Posted by lmilesw
I never fiddle with editing the theme files so I can't give you an "experienced" answer. Sorry.
That is OK. Thank you very much for your answer in the first place. At least I know what the deal is, and that is always a good think.
  #6  
Old Jun 2, 2011, 04:14 PM
juggledad's Avatar
juggledad
 
23,648 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
try putting it just before line 16
HTML Code:
	<?php while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>
of course the <body> and </body> are 'illegal' - by definition, you can only have one <body> tag on a page and some browsers will have a problem with it.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Jun 3, 2011, 09:36 AM
Harald
 
72 posts · Mar 2010
Quote:
Originally Posted by juggledad
try putting it just before line 16
HTML Code:
    <?php while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>
of course the <body> and </body> are 'illegal' - by definition, you can only have one <body> tag on a page and some browsers will have a problem with it.
It worked perfect. Thank you so much for all your help. It is always nice to be on the latest version, even if 3.6.4 worked great for me. Atahualpa is by far the best theme out there.

Last edited by lmilesw; Jun 3, 2011 at 09:43 AM.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to put code in loop with instruction for single.php? annsworld Center area post/pages 5 Dec 1, 2012 09:52 PM
WP-Table Reloaded code insert johnnybravo Plugins & Atahualpa 8 May 31, 2011 02:35 AM
Where to insert code for jquery plugins ? twola Header configuration & styling 3 Jan 23, 2010 11:18 PM
Weird Error With Code in Loop as Opposed to index.php adum Post-Kicker, -Byline & -Footer 1 Oct 10, 2009 04:48 AM
Loop Code Displaying Instead of Pages TheInfamousGdub Atahualpa 3 Wordpress theme 6 Aug 27, 2009 08:52 PM


All times are GMT -6. The time now is 09:39 AM.


Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.