Guten Abend,
ich möchte gerne auf den Seiten und Beiträgen das Datum angezeigt haben, wann zuletzt eine Aktualisierung erfolgte, zum Beispiel:
Letzte Aktualisierung vom: 20.08.2013
Wie kann ich ds machen?
Danke
Walter
Um schreiben oder kommentieren zu können, benötigen Sie ein Benutzerkonto.
Sie haben schon ein Benutzerkonto? Melden Sie sich hier an.
Jetzt anmeldenHier können Sie ein neues Benutzerkonto erstellen.
Neues Benutzerkonto erstellen
Guten Abend,
ich möchte gerne auf den Seiten und Beiträgen das Datum angezeigt haben, wann zuletzt eine Aktualisierung erfolgte, zum Beispiel:
Letzte Aktualisierung vom: 20.08.2013
Wie kann ich ds machen?
Danke
Walter
Hallo!
Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.
Ich habe vergessen zu erwähnen, dass ich WP 3.6 und Twenty Thirteen habe...
Danke.
Walter
Vielen Dank.
Wo soll das rein? Ich habe es mal an den Anfang der style.css gesetzt, klappt aber nicht....
Gruss
Walter
Wo soll das rein? Ich habe es mal an den Anfang der style.css gesetzt, klappt aber nicht....
Wenn Du PHP nicht von CSS unterscheiden kannst, dann solltest Du Dein Vorhaben noch einmal überdenken. Ich kann Dir jetzt zwar auch nicht sagen, wo Du das notieren könntest, von der general-template.php las ich etwas, doch bedenke, anders als bei kleinen Fehlern in der CSS würde jeder kleine Fehler in einer PHP-Datei einen Parser-Error auslösen.
Der Code gehört für Seiten in die page.php und für Beiträge in die single.php und zwar immer an die gewünschte Stelle wo es angezeigt werden soll.
Aber ohne jeglichen Code-Kenntnisse findest du die gewünschte Stelle vermutlich eher schwer.
Hallo Maxe,
vielen Dank. Bei der page.php habe ich die Stelle auf Anieb gefunden, auch wenn ich das Ergebnis gerne zentriert und etwas dezenter, also kleinere Schrift, gehabt hätte, siehe hier:
http://hoffmann-jahn.de/?page_id=9
Bei der single.php finde ich die Stelle in der Tat nicht. Vielleicht kannst du helfen? Hier die php, danke:
<?php
/**
* The Template for displaying all single posts.
*
* @package WordPress
* @subpackage Twenty_Thirteen
* @since Twenty Thirteen 1.0
*/
get_header(); ?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php twentythirteen_post_nav(); ?>
<?php comments_template(); ?>
<?php endwhile; ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
Müsste, so wie es aussieht, in die content.php geschrieben werden bzw. evtl. in alle content-***.php.
Mit der general-template.php hatte ich mich verlesen, da wird die Funktion definiert und nicht eingefügt. Habe es gerade einmal in der content-page.php probiert, da wird es in den statischen Seiten mittig unterm Text über der Linie ausgegeben, wenn ich es so einfüge:
</footer><!-- .entry-meta -->
<p style="text-align:center">Letzte Aktualisierung vom: <?php the_modified_date('j. F Y'); ?></p>
</article><!-- #post -->
Ohne Zeilenumbruch, der wird nur hier angezeigt.
Hallo Melowo,
danke, aber bei mir gibt es im Verzeichnis
>wp-content
>themes
>twentythirteen
"keine "content-page.php".
Kann die noch wo anders sein oder muss ich eine anlgegen?
Danke.
Walter
Es müsste natürlich irgendwo mit in den Loop. Versuche es mal in der Zelle vor dem endif
content.php probiere mal das da
<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
ENTWEDER hier oder
<?php else : ?>
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h1>
HIER
<?php endif; // is_single() ?>
<div class="entry-meta">
ODER HIER UNTEN
<?php twentythirteen_entry_meta(); ?>
<?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
Alles anzeigen
Hallo Monika,
vielen Dank.
Ich habe mal das von #3 und #9 an den von dir vorgeschlagenen Stellen eingefügt: kein Ergebnis.
Hier die content.php. Vielleicht kannst du ja was erkennen, was hinderlich ist:
<?php
/**
* The default template for displaying content. Used for both single and index/archive/search.
*
* @package WordPress
* @subpackage Twenty_Thirteen
* @since Twenty Thirteen 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
<div class="entry-thumbnail">
<?php the_post_thumbnail(); ?>
</div>
<?php endif; ?>
<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php else : ?>
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h1>
<?php endif; // is_single() ?>
<div class="entry-meta">
<?php twentythirteen_entry_meta(); ?>
<?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentythirteen' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<?php if ( comments_open() && ! is_single() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a comment', 'twentythirteen' ) . '</span>', __( 'One comment so far', 'twentythirteen' ), __( 'View all % comments', 'twentythirteen' ) ); ?>
</div><!-- .comments-link -->
<?php endif; // comments_open() ?>
<?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?>
<?php get_template_part( 'author-bio' ); ?>
<?php endif; ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->
Danke. Gruss Walter
Siehst Du, so wenig kenn ich mich aus, probierte es nur mit Twenty Twelve aus. Dann wird Dir vielleicht nichts weiter übrig bleiben und Du musst so vorgehen, wie SirEctor schrieb und suchen, bist Du die richtige/n gefunden hast.
Hallo SirEctor,
danke, habe es versucht, klappt aber nciht....
Gruss
Walter
Siehst Du, so wenig kenn ich mich aus, probierte es nur mit Twenty Twelve aus. Dann wird Dir vielleicht nichts weiter übrig bleiben und Du musst so vorgehen, wie SirEctor schrieb und suchen, bist Du die richtige/n gefunden hast.
Hallo Melewo,
kein Problem. Trotzdem Danke für deine Hilfe...
Gruss
Walter
für Beiträge
content.php
<?php
/**
* The default template for displaying content. Used for both single and index/archive/search.
*
* @package WordPress
* @subpackage Twenty_Thirteen
* @since Twenty Thirteen 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
<div class="entry-thumbnail">
<?php the_post_thumbnail(); ?>
</div>
<?php endif; ?>
<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php else : ?>
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h1>
<?php endif; // is_single() ?>
<div class="entry-meta">
<?php twentythirteen_entry_meta(); ?>
<p>Letzte Aktualisierung vom: <?php the_modified_date('j. F Y'); ?></p>
<?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
Alles anzeigen
für Seiten
page.php
Hallo Monika,
vielen Dank.
Ich habe nun folgendes gemacht:
Für Beiträge: ich habe die content.php komplett ersetzt mit deinem Vorschlag aus #18. Dann passiert allerdings folgendes:
a) wenn ich einen Beitrag erstelle als "Stardard-Formatvorlage", dann erscheint zwar das Aktualisierungsdatum unten, und die Überschrift. Aber keine Text mehr. Siehe Test 2 auf meiner Seite
http://hoffmann-jahn.de
b) wenn wenn ich einen Beitrag erstelle als "Bild-Formatvorlage", dann erscheint das Aktualisierungsdatum unten nicht, dafür aber die Überschrift und Text. Siehe Test 1 auf meiner Seite
Für Seiten: ich habe die page.php komplett ersetzt gegen deine page.php aus #18 und da erscheint das Aktualisierungsdatum absolut korrekt (und schön). Bei "Seiten" ist das Problem also erledigt. Nur eben für Beiträge nicht...
Danke.
Walter
Probiere es so:
[COLOR=#0000BB][FONT=monospace]<?php
[/FONT][/COLOR][COLOR=#FF8000][FONT=monospace]/**
* The default template for displaying content. Used for both single and index/archive/search.
*
* @package WordPress
* @subpackage Twenty_Thirteen
* @since Twenty Thirteen 1.0
*/
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>
[/FONT][/COLOR]
[COLOR=#000000][FONT=monospace]<article id="post-[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]<?php the_ID[/FONT][/COLOR][COLOR=#007700][FONT=monospace](); [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>[/FONT][/COLOR][COLOR=#000000][FONT=monospace]" [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]<?php post_class[/FONT][/COLOR][COLOR=#007700][FONT=monospace](); [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>[/FONT][/COLOR][COLOR=#000000][FONT=monospace]>[/FONT][/COLOR]
[COLOR=#000000][FONT=monospace] <header class="entry-header">[/FONT][/COLOR]
[COLOR=#0000BB][FONT=monospace]<?php [/FONT][/COLOR][COLOR=#007700][FONT=monospace]if ( [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]has_post_thumbnail[/FONT][/COLOR][COLOR=#007700][FONT=monospace]() && ! [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]post_password_required[/FONT][/COLOR][COLOR=#007700][FONT=monospace]() ) : [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>
[/FONT][/COLOR][COLOR=#000000][FONT=monospace] <div class="entry-thumbnail">[/FONT][/COLOR]
[COLOR=#0000BB][FONT=monospace]<?php the_post_thumbnail[/FONT][/COLOR][COLOR=#007700][FONT=monospace](); [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>
[/FONT][/COLOR][COLOR=#000000][FONT=monospace] </div>[/FONT][/COLOR]
[COLOR=#0000BB][FONT=monospace]<?php [/FONT][/COLOR][COLOR=#007700][FONT=monospace]endif; [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>
[/FONT][/COLOR]
[COLOR=#0000BB][FONT=monospace]<?php [/FONT][/COLOR][COLOR=#007700][FONT=monospace]if ( [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]is_single[/FONT][/COLOR][COLOR=#007700][FONT=monospace]() ) : [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>
[/FONT][/COLOR][COLOR=#000000][FONT=monospace] <h1 class="entry-title">[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]<?php the_title[/FONT][/COLOR][COLOR=#007700][FONT=monospace](); [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>[/FONT][/COLOR][COLOR=#000000][FONT=monospace]</h1>[/FONT][/COLOR]
[COLOR=#000000][FONT=monospace] <?php the_content(); ?>[/FONT][/COLOR]
[COLOR=#0000BB][FONT=monospace]<?php [/FONT][/COLOR][COLOR=#007700][FONT=monospace]else : [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>
[/FONT][/COLOR][COLOR=#000000][FONT=monospace] <h1 class="entry-title">[/FONT][/COLOR]
[COLOR=#000000][FONT=monospace] <a href="[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]<?php the_permalink[/FONT][/COLOR][COLOR=#007700][FONT=monospace](); [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>[/FONT][/COLOR][COLOR=#000000][FONT=monospace]" rel="bookmark">[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]<?php the_title[/FONT][/COLOR][COLOR=#007700][FONT=monospace](); [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>[/FONT][/COLOR][COLOR=#000000][FONT=monospace]</a>[/FONT][/COLOR]
[COLOR=#000000][FONT=monospace] </h1>[/FONT][/COLOR]
[COLOR=#0000BB][FONT=monospace]<?php [/FONT][/COLOR][COLOR=#007700][FONT=monospace]endif; [/FONT][/COLOR][COLOR=#FF8000][FONT=monospace]// is_single() [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>
[/FONT][/COLOR]
[COLOR=#000000][FONT=monospace] <div class="entry-meta">[/FONT][/COLOR]
[COLOR=#0000BB][FONT=monospace]<?php twentythirteen_entry_meta[/FONT][/COLOR][COLOR=#007700][FONT=monospace](); [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>
[/FONT][/COLOR][COLOR=#000000][FONT=monospace] <p>Letzte Aktualisierung vom: [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]<?php the_modified_date[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'j. F Y'[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>[/FONT][/COLOR][COLOR=#000000][FONT=monospace]</p>[/FONT][/COLOR]
[COLOR=#0000BB][FONT=monospace]<?php edit_post_link[/FONT][/COLOR][COLOR=#007700][FONT=monospace]( [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]__[/FONT][/COLOR][COLOR=#007700][FONT=monospace]( [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'Edit'[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'twentythirteen' [/FONT][/COLOR][COLOR=#007700][FONT=monospace]), [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'<span class="edit-link">'[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'</span>' [/FONT][/COLOR][COLOR=#007700][FONT=monospace]); [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>
[/FONT][/COLOR][COLOR=#000000][FONT=monospace] </div><!-- .entry-meta -->[/FONT][/COLOR]
[COLOR=#000000][FONT=monospace] </header><!-- .entry-header -->[/FONT][/COLOR]
Alles anzeigen
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!