Wordpress

To correct the path to the images. You can either hard code the URLs in there: http://yourdomain.com/blog/wp-content/themes/awp/images/future_slide.jpg or you can use this template tag:

<?php bloginfo('template_directory'); ?>

so it would become:

<?php bloginfo('template_directory'); ?>/images/future_slide.jpg

awesome great!

Several questions:

I got the categories setup and I have a css setting written up which declares a “current” category. If the user is reading a single blog post in that category or browsing in that category how can i set it that the css “current” class is activated for that particular category? can that be done?

Also I see there is a search function within Wordpress and it provides its own search textbox and search button but is there way to use the code I written out:

<div id="search">
        <form action="#" method="post">
            <fieldset>
                <div class="search-input-bg">
                    <input type="text" class="search-input" value="search" name="search" 
                    onfocus="if(this.value=='search') {this.value='';}" onblur="if(this.value=='') {this.value='search'}" />
                </div>
    			<div class="form-button"><span><input type="submit" value="GO" name="go" /></span></div>          
            </fieldset>
        </form>    	
    </div>

By default the wp_list_categories() function adds a class of “current-cat” to the current category. So you can use this: li.current-cat { … }

The search? Yes just paste this into searchform.php:

<div id="search">
 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
  <fieldset>
   <div class="search-input-bg">
    <input type="hidden" name="s" value="1" />
    <input type="text" class="search-input" value="search" name="s" id="s" onfocus="if(this.value=='search') {this.value='';}" onblur="if(this.value=='') {this.value='search'}" />
   </div>
   <div class="form-button"><span><input type="submit" value="GO" name="go" /></span></div>          
  </fieldset>
 </form>   	
</div>

The only things I changed are:

  1. the form action: <?php echo $_SERVER[‘PHP_SELF’]; ?>
  2. I added this line as I think it is required: <input type=“hidden” name=“s” value=“1” />
  3. I added name=“s” id=“s” to the input as I think they are also required.

http://codex.wordpress.org/Creating_a_Search_Page

sweet!

thanks i appreciate it. but there is two files:

archive.php and archives.php

but codex just refers to archives.php

is there any difference?

Yes. archive.php is for displaying categories, date, author and such post pages and [URL=“http://codex.wordpress.org/Creating_an_Archive_Index”]archives.php is for a page that lists your archives by category, date, author and so on (kinda like in the sidebar.php file)

ok so i am working archive.php (don’t really need archives.php)

and for each post I want the setup to be in this html original code:

                <li>
                	<div class="news-date">21.06.2009</div>
                    <a href="#" class="news-item">Innova Construct opens it’s new headquarters in Los Angelos</a>
                </li>



is this the correct translation?

<li>
                	<div class="news-date"><?php the_time('l, F jS, Y') ?></div>
                    <a href="<?php echo $guid; ?>" class="news-item"><?php the_title(); ?></a>
                </li>

What is: <?php echo $guid; ?> ?

Other than that it looks good but I might just not know what this is. :blush:

that should be the URL.

While that may be completely valid and if it’s working than it must be good to go. Though I’m used to <?php the_permalink() ?> for the URL. :slight_smile:

doh alright. i guess that is how it is supposed to be cause were i used that php code snippet was for my point of sale page. if you see at the bottom it is pulling the newest posts.

Yeah the reference I found to that snippet was for a latest post widget. :slight_smile:

how can i set the different pages for the archive.php file? for example if there is more than one page it will post like here in the html version:

            <div class="pagination">
                <ul>
                    <li><a href="#" class="button"><span>1</span></a></li>
                    <li><a href="#" class="button active-pag"><span>2</span></a></li>    
                    <li><a href="#" class="button"><span>3</span></a></li>
                    <li><a href="#" class="button"><span>4</span></a></li>                    
                </ul>
            </div>

how can i convert that to the proper PHP language?

There is this plugin: http://wordpress.org/extend/plugins/wp-page-numbers/

Though I might be misunderstanding what you’re asking. If so, just let me know. :slight_smile:

no what i meant was if let’s say i search through an archive and is there a limit of posts it will show before going to the next page?

You’re asking how to limit the number of posts that appear on an archive page? If so, this is under settings > reading > number of posts to display or something similar. This will also limit the number of posts on the main posts page as well.

ok for example, let’s say i pull an archive and get this page template working and it has some limit to the number of links it will display correct? if so then let’s say for example the limit is at 50 and there are 100 links so it will break up onto two pages but how do i display the link to page two in that format?

You mean like: 1 2 3 4 … and so on. Each being a link to the next page in line of the archives?

That plug in I linked above will produce that. You just need to add the code for it to the archive.php file, upload it and activate it. If I am still not following. I am sorry. :blush: :wink:

Let me know. :slight_smile:

Silver you can set the number of results shown on each page by using what ben suggested in post #49. There is a plug in called CQS (Custom Query String) that allows you to adjust the number of posts per various elements of the page. For example, I have my default setting set at 4, however I set the month option (through CQS) to -1 which displays all results for a month. Since the maximum number of posts per month I do is under 10 - I thought that would be logical.

In post #50, you mention the number of links. Do you mean the numbber of results to display or the number of individual links? For example if a post has 6 links in it do you want it to count as 1 or 6? Are you asking how do you accommodate the number of results per page? At the bottom of most of my pages I have

posts_nav_link(' &#8212; ', __('&laquo; Previous Page'), __('Next Page &raquo;'))

which shows a previous/next page when appropriate. WP displays this when needed and parses the following pages automagically. Again you can use the plug in Ben mentioned to make it prettier if you wish

alright i will use that plugin,

i know this is the code snippet for an external poll of the latest name of the post but what is the internal one?

<?php echo $post_title; ?>