Sundace60
Registered Member
- Joined
- Jun 22, 2009
- Messages
- 53
- Reaction score
- 18
I have a string in my main index that looks like this:
What this does is post info like a "Sticky" on a forum at the very top of the list. It does this for every category that the "Sticky" applies to.
I want the sticky to be placed in a table that is 1 row with 4 columns that will apply to the respective categories.
Here is how the code looks on the main index page:
My thinking is that I should just make another class selector and place the html code where I want the table to appear and when the server reads the "sticky" string, it will just place (echo) the data to the correct location on the web page.
I just can't find any examples on the web to back up my theory and I can't get it to work correctly no matter what I do.
Can anyone here give me some help.
(I won't divulge my site, but the code above is from a classified ad script called "ClassiPress" which is a theme you can use in Wordpress). I just modified the hell out of it to suit my purpose.)
Code:
if (is_sticky()) { echo " id='sticky' "; } echo ">";
I want the sticky to be placed in a table that is 1 row with 4 columns that will apply to the respective categories.
Here is how the code looks on the main index page:
Code:
<ul id="catnav">
<li<?php if ( is_home() ) { echo " class=\"current-cat\""; } ?>><a href="<?php bloginfo('url'); ?>" ><?php _e('Latest Listings','cp'); ?></a></li>
<?php wp_list_categories('show_count=0&hide_empty=true&orderby=name&order=asc&title_li='); ?>
<li><div class="clear"></div></li>
</ul>
<?php if ( is_category() && function_exists('bcn_display')) { ?>
<div class="subnav">
<small><?php if(function_exists('bcn_display')) { bcn_display(); } ?></small>
</div>
<?php } ?>
<!-- HERE IS WHERE THE 1 ROW AND 4 COLUMNS WILL START -->
<div class="main">
<div class="listing">
<div class="head">
<div class="clear"></div>
</div>
<div class="list">
<?php
$i = 1;
if(!empty($_GET['sort']))
{
$orderby=trim($_GET['sort']);
$order=trim($_GET['order']);
$key=trim($_GET['key']);
// create the sort by injection
$posts = query_posts($query_string . '&orderby='.$orderby.'&meta_key='.$key.'&order='.$order.'');
}
if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php if ($i % 2 == 0) { $alt = " class=\"alt\""; } else { $alt = " class=\"no\""; } echo "<div" . $alt;
<!-- HERE IS WHERE THE STICKY IS CALLED AND I WANT IT PLACED IN THE AREA ABOVE THIS -->
if (is_sticky()) { echo " id='sticky' "; } echo ">";
?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php if ( get_option('main_page_img') != "no" ) { ?>
<span class="image">
<?php $images = get_post_meta($post->ID, "images", true);
if (empty($images)) {?>
<div class="main_page_no_img"><img src="<?php bloginfo('template_url'); ?>/images/no-pic.png" alt="No Photo" border="0" /></div></span>
I just can't find any examples on the web to back up my theory and I can't get it to work correctly no matter what I do.
Can anyone here give me some help.
(I won't divulge my site, but the code above is from a classified ad script called "ClassiPress" which is a theme you can use in Wordpress). I just modified the hell out of it to suit my purpose.)