Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   New Versions, & Updating (http://forum.bytesforall.com/forumdisplay.php?f=12)
-   -   [SOLVED] How to insert code above the loop? (http://forum.bytesforall.com/showthread.php?t=14455)

Harald Jun 2, 2011 01:26 AM

[SOLVED] How to insert code above the loop?
 
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

lmilesw Jun 2, 2011 07:11 AM

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.

Harald Jun 2, 2011 07:58 AM

Quote:

Originally Posted by lmilesw (Post 66954)
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.

lmilesw Jun 2, 2011 03:37 PM

I never fiddle with editing the theme files so I can't give you an "experienced" answer. Sorry. :(

Harald Jun 2, 2011 03:44 PM

Quote:

Originally Posted by lmilesw (Post 66985)
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.

juggledad Jun 2, 2011 04:14 PM

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.

Harald Jun 3, 2011 09:36 AM

Quote:

Originally Posted by juggledad (Post 66994)
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.


All times are GMT -6. The time now is 09:59 PM.

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