Wordpress Template Help !!!

moneykz

Junior Member
Joined
Mar 8, 2008
Messages
197
Reaction score
25
I have looked all over wordpress for this and cant findit.

I want to make a simple adjustment to my index.php page in wordpress.

This is what Im looking to do on the index page.

Thursday, February 5th, 2009
Link today 1
Link today 2
link today 3

Thursday, February 4th, 2009
Link today 1
Link today 2

Thursday, February 3th, 2009
Link today 1
Link today 2

Does anyone know the code for this? Thanks!!!
 
I'm not sure I understand what it is you want, however I'm willing to help you out, you can PM me an example or your website and I can help set you up. Give thanks if I actually help you out in the end.
 
The index page on wordpress is normally like this

Title
Descriptions

Im trying to set that up differently to only show the days new links.
 
Gotcha, give me a few minutes to whip up the edits you have to do in the index.php. I will use Kubrik theme (the default wordpress theme) to work from.
 
Ok this is fairly simple and the only hitch is you will need to use the "Excerpt" box in your Posts and put your links of the day in there such as this example:
Code:
<a href="http:/whateverthelinkis">Link 1</a>
<a href="http:/whateverthelinkis">Link 2</a>
and so forth, you get the idea

Edit Index.php
Find this line of code in "Index.php" (the example is from Kubrik Theme - Wordpress Default Theme):
Code:
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
				<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>

				<div class="entry">
					<?php the_content('Read the rest of this entry »'); ?>
				</div>

Replace with this:
Code:
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">

<!--Modified Link Title to Dates by RevolWerx-->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_time('F jS, Y') ?></a></h2>

<!--Removed and replaced above by RevolWerx
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
-->
				
<!--Removed as not needed by RevolWerx
<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
-->

				<div class="entry">

<!--Added Use The Post Excerpt Instead by RevolWerx-->
<?php the_excerpt(); ?>
					
<!-- Removed content and replaced by Excerpts above by RevolWerx
<?php the_content('Read the rest of this entry »'); ?>
-->
</div>

I actually tested this and it works fine using Kubrik theme but may need to be modified to fit your Theme.
 
Last edited:
Im not sure this is what Im looking for, this is what I have now

<?php the_time('l, F jS, Y') ?><br>
<?php get_archives('postbypost', 30); ?>

But this shows all links. I want to seperate them out by the days post.
 
No prob, it was fun to figure it out a solution. Anyhow I'll take another look and see if I have something to add.
 
How about this?
Code:
<?php the_time('l, F jS, Y') ?><br />
<?php get_archives('type=daily'); ?>
 
here is an example website of what Im trying to do
http://www.comingsoon.net/trailers/
 
This should do the trick.
Find the start of "The Loop" looks something like this
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>


Put this inside "The Loop" (this puts the date in an H2 tag and the link in a Block:
<?php the_date('Y-m-d', '<h2>', '</h2>'); ?>
<a href="<?php the_permalink(); ?>" style="display:block;"><?php the_title(); ?></a>


remove anything in there before the:
<?php endwhile; ?>

Should look something like this in the index.php in the end (your template may vary because of Div's and such being in "the loop"):
Code:
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_date('Y-m-d', '<h2>', '</h2>'); ?>
<a href="<?php the_permalink(); ?>" style="display:block;"><?php the_title(); ?></a>
<?php endwhile; ?>
 
Last edited:
I got it to work, thanks your the best !!!
 
Last edited:
The code above does hot have an <?php endif; ?> because it was being used with Kubrik theme. Can you paste the entire index.php before the edits so I can see where it might fail and get it fixed. Which theme are you using? I have tested it with the Kubrik theme.

If using Kubrik it would look like this with the edits:
Code:
<?php
/**
 * @package WordPress
 * @subpackage Default_Theme
 */

get_header(); ?>

	<div id="content" class="narrowcolumn">

	<?php if (have_posts()) : ?>

		<?php while (have_posts()) : the_post(); ?>

			<?php the_date('Y-m-d', '<h2>', '</h2>'); ?>

			<a href="<?php the_permalink(); ?>" style="display:block;"><?php the_title(); ?></a>

		<?php endwhile; ?>

		<div class="navigation">
			<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
			<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
		</div>

	<?php else : ?>

		<h2 class="center">Not Found</h2>
		<p class="center">Sorry, but you are looking for something that isn't here.</p>
		<?php get_search_form(); ?>

	<?php endif; ?>

	</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
 
Last edited:
figure it out, thanks
 
Last edited:
Back
Top