• Das kreative Thema des Monats Oktober wird vor allem diejenigen unter Euch besonders ansprechen, denen Do-it-yourself quasi im Blut liegt. Zeigt uns Eure Improvisationskünste oder fotografiert, was andere Leute sich so im Alltag zusammengestrickt haben. --> Zum Mitmachen bitte hier klicken

Probleme mit Wordpress PHP Code

@pollo

Raisin Rouge
Registriert
03.08.06
Beiträge
1.181
Hallo,

Problem: Ich möchte die Ausgabe des Sub-Contents (Datum, Kategorie, Bearbeiten) in eine andere Tabellenspalte (links neben den Content) schieben. Ich bekomme nur für den ersten Artikel eine korrekte Ausgabe, für alle nachfolgenden fehlt das Datum. Ich gehe davon aus, dass ich die Tabelle falsch gesetzt habe. Leider kann ich nicht 100% nachvollziehen was Wordpress mir da im PHP sagen will, so dass ich nur nach dem Try & Error Verfahren und einschlägigen PHP Seiten vorgehen kann.

Der ganze Spaß sieht so aus: Klick Mich!

Code:
<?php get_header(); ?>
<table border="1">
    <tr>
        <td>
                <h2><?php the_time(__('F jS, Y', 'kubrick')) ?> <!-- by <?php the_author() ?> --></h1>
                  
                <?php the_tags(__('Tags:', 'kubrick') . ' ', ', ', '<br />'); ?> 
                
                <?php printf(__('Kategorie %s', 'kubrick'), get_the_category_list(', ')); ?> <br>
                
                <?php edit_post_link(__('Edit', 'kubrick'), '', ' <br> '); ?>  
                
                <?php comments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?>
        
        </td>
        
        <td>


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

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

            <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
                <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></h2>
                <div class="entry">
                    <?php the_content(__('Read the rest of this entry »', 'kubrick')); ?>
                </div>
                </div>            
          </td>
          <td>
                  <h2><?php the_time(__('F jS, Y', 'kubrick')) ?> <!-- by <?php the_author() ?> --></h1>
                  
                <?php the_tags(__('Tags:', 'kubrick') . ' ', ', ', '<br />'); ?> 
                
                <?php printf(__('Kategorie %s', 'kubrick'), get_the_category_list(', ')); ?> <br>
                
                <?php edit_post_link(__('Edit', 'kubrick'), '', ' <br> '); ?>  
                
                <?php comments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?>
        </td>
    </tr>
    <tr>
        <td></td>
    <td>
   <?php endwhile; ?>
 
        <?php next_posts_link(__('« Older Entries', 'kubrick')) ?>
        <?php previous_posts_link(__('Newer Entries »', 'kubrick')) ?>
    
        <?php else : ?>
        
        <?php _e('Not Found', 'kubrick'); ?>
        <?php _e('Sorry, but you are looking for something that isn’t here.', 'kubrick'); ?>
        <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
        <?php endif; ?>
    
    </td>
 </tr>
        
</table> 
    
<?php get_footer(); ?>
 
Ich würde aus

<table border="1">

das machen:

<table border="1" style="empty-cells:show;">

oder zwischen

<td></td>

ein geschützes Leerzeichen einfügen

<td>&nbsp;</td>

oder Unicode:

<td> </td>

Edit: Unicode zeigt er leider nicht an, benutz selfhtml

Edit2: oder unten ein <td colspan="2"> und das einsame <td></td> weglassen.
 
Wenn ich das "einsame" <td></td> weg lasse, dann siehts lustig aus aber nicht wie gewünscht :-p
 
Hmm, normalerweise is es so, das "leere" <td>'s nicht richtig angezeigt werden.