Zulfus
07-06-2011, 12:34 AM
Right, I've coded up a basic site in wordpress for a mate, it's my first attempt at wordpress, but so far so good.
Until she asked me to add a little arrow next to the currently viewed page. No worries I though, simple list & some PHP, but alas, I can't get the arrow to display quite right... it's more a trapezium..
Basically I'm adding the ID #current to the currently viewed page which is suppose to position a triangle next to it... the positioning part i'm having trouble with however, also it's looking more like a trapezium than a triangle..
ANYONE Who can figure this out i'll be eternally grateful to. I've put so many hours into just this little arrow...
Here's the CSS:
/*
Theme Name: LForrester
Theme URI: http://laurenforrester.co.uk
Description: A search engine optimized Wordpress Portfolio for Lauren Forrester.
Version: 1.0
Tags: Graphic Design, Art Direction, Portfolio, Leeds, Lauren Forrester
.
Like WordPress, this work is released under GNU General Public License, version 2 (GPL).
http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
/* Reset default browser styles */
@import url('styles/reset.css');
/* Rebuild default browser styles */
@import url('styles/rebuild.css');
/* Essential Wordpress Styling */
@import url('styles/wp.css');
h1 {letter-spacing:2px}
A:link {text-decoration: none; color:#000000;}
A:visited {text-decoration: none; color:#000000;}
A:active {text-decoration: none; color:#000000;}
A:hover {text-decoration: none; color:#000000;}
#header{ z-index: 1;
Position: absolute;
Left:50%;
Top: 40px;
width: 140px;
height: 200px;
margin-left: -470px;
font-size: 40;
color:#000000 ;
background-color:#FFFFFF}
#titletag{ z-index: 2;
Position: absolute;
Left:50%;
Top: 40px ;
width: 200px;
height: 200px;
margin-left: -245px;
font-size: 10;
color:#000000 ;
background-color:#FFFFFF}
#sidebar{ z-index: 3;
Position: absolute;
Left:50%;
Top: 270px ;
width: 150px;
height: 240px;
margin-left: -468px;
font-size: 10;
color:#000000 ;
background-color:#FFFFFF}
#main{ z-index: 4;
Position: absolute;
Left:50%;
Top: 266px ;
width: 600px;
margin-left: -200px;
font-size: 10;
color:#000000 ;
background-color:#FFFFFF;}
ul.arrowselect{
list-style-type: none;
margin:0;
padding:0;
}
ul.arrowselect li{
position: relative;
padding:0;
}
#current{ /* use CSS generated content to add arrow to the menu */
display: inline;
position:relative;
left: -5px;
width: 0;
height: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid purple;
}
Code for the Wordpress Sidebar:
<div id="sidebar">
<h1>ABOUT ME</h1><br>
<p>
<ul class="arrowselect">
<li<?php
if (is_page('about-me'))
{
echo " id=\"current\"";
}?>><a href="http://laurenforrester.co.uk/about-me">About Me</a><br></li>
<li<?php
if (is_page('contact-me'))
{
echo " id=\"current\"";
}?>><a href="http://laurenforrester.co.uk/contact-me">Contact Me</a><br></li>
<li<?php
if (is_page('curriculum-vitae'))
{
echo " id=\"current\"";
}?>><a href="http://laurenforrester.co.uk/curriculum-vitae/">Curriculum Vitae</a></li>
</ul>
</p>
<br>
<h1>PORTFOLIO</h1><br>
<p>
<ul class="arrowselect">
<?php
$pages = get_pages();
foreach ($pages as $pagg) {
if ($pagg->ID > 10) {$option = '<li><a href="'.get_page_link($pagg->ID).'">';
$option .= $pagg->post_title;
$option .= '</a></li><br>';
echo $option;}
} ?>
</ul>
</p>
<h1>BLOG</h1><br>
<p><a href="http://www.laurenforrester.co.uk/wp-content/themes/LForrester/latest.php">Latest Posts</a><br>
<?php wp_get_archives('type=monthly&limit=4&format=custom&before=&after=<br>'); ?>
</div>
I'm going to leave the issue live on the website so you guys can check it out:
www.LaurenForrester.co.uk
Seriously Would LOVE you guys so much if you could fix this.
Thanks,
Zul
EDIT: Also, now seems to not even do anything in chrome... I've no idea what i've done, i've been playing with this for so long I can't even think straight anymore... >.<
Until she asked me to add a little arrow next to the currently viewed page. No worries I though, simple list & some PHP, but alas, I can't get the arrow to display quite right... it's more a trapezium..
Basically I'm adding the ID #current to the currently viewed page which is suppose to position a triangle next to it... the positioning part i'm having trouble with however, also it's looking more like a trapezium than a triangle..
ANYONE Who can figure this out i'll be eternally grateful to. I've put so many hours into just this little arrow...
Here's the CSS:
/*
Theme Name: LForrester
Theme URI: http://laurenforrester.co.uk
Description: A search engine optimized Wordpress Portfolio for Lauren Forrester.
Version: 1.0
Tags: Graphic Design, Art Direction, Portfolio, Leeds, Lauren Forrester
.
Like WordPress, this work is released under GNU General Public License, version 2 (GPL).
http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
/* Reset default browser styles */
@import url('styles/reset.css');
/* Rebuild default browser styles */
@import url('styles/rebuild.css');
/* Essential Wordpress Styling */
@import url('styles/wp.css');
h1 {letter-spacing:2px}
A:link {text-decoration: none; color:#000000;}
A:visited {text-decoration: none; color:#000000;}
A:active {text-decoration: none; color:#000000;}
A:hover {text-decoration: none; color:#000000;}
#header{ z-index: 1;
Position: absolute;
Left:50%;
Top: 40px;
width: 140px;
height: 200px;
margin-left: -470px;
font-size: 40;
color:#000000 ;
background-color:#FFFFFF}
#titletag{ z-index: 2;
Position: absolute;
Left:50%;
Top: 40px ;
width: 200px;
height: 200px;
margin-left: -245px;
font-size: 10;
color:#000000 ;
background-color:#FFFFFF}
#sidebar{ z-index: 3;
Position: absolute;
Left:50%;
Top: 270px ;
width: 150px;
height: 240px;
margin-left: -468px;
font-size: 10;
color:#000000 ;
background-color:#FFFFFF}
#main{ z-index: 4;
Position: absolute;
Left:50%;
Top: 266px ;
width: 600px;
margin-left: -200px;
font-size: 10;
color:#000000 ;
background-color:#FFFFFF;}
ul.arrowselect{
list-style-type: none;
margin:0;
padding:0;
}
ul.arrowselect li{
position: relative;
padding:0;
}
#current{ /* use CSS generated content to add arrow to the menu */
display: inline;
position:relative;
left: -5px;
width: 0;
height: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid purple;
}
Code for the Wordpress Sidebar:
<div id="sidebar">
<h1>ABOUT ME</h1><br>
<p>
<ul class="arrowselect">
<li<?php
if (is_page('about-me'))
{
echo " id=\"current\"";
}?>><a href="http://laurenforrester.co.uk/about-me">About Me</a><br></li>
<li<?php
if (is_page('contact-me'))
{
echo " id=\"current\"";
}?>><a href="http://laurenforrester.co.uk/contact-me">Contact Me</a><br></li>
<li<?php
if (is_page('curriculum-vitae'))
{
echo " id=\"current\"";
}?>><a href="http://laurenforrester.co.uk/curriculum-vitae/">Curriculum Vitae</a></li>
</ul>
</p>
<br>
<h1>PORTFOLIO</h1><br>
<p>
<ul class="arrowselect">
<?php
$pages = get_pages();
foreach ($pages as $pagg) {
if ($pagg->ID > 10) {$option = '<li><a href="'.get_page_link($pagg->ID).'">';
$option .= $pagg->post_title;
$option .= '</a></li><br>';
echo $option;}
} ?>
</ul>
</p>
<h1>BLOG</h1><br>
<p><a href="http://www.laurenforrester.co.uk/wp-content/themes/LForrester/latest.php">Latest Posts</a><br>
<?php wp_get_archives('type=monthly&limit=4&format=custom&before=&after=<br>'); ?>
</div>
I'm going to leave the issue live on the website so you guys can check it out:
www.LaurenForrester.co.uk
Seriously Would LOVE you guys so much if you could fix this.
Thanks,
Zul
EDIT: Also, now seems to not even do anything in chrome... I've no idea what i've done, i've been playing with this for so long I can't even think straight anymore... >.<