WordPress Attachments (Dateianhänge)

Search
  • Blog
  • About
  • Services
  • Work
  • Contact
  • News
  • Articles
  • Twitter

  • TYPO3 – Bild Qualität ändern
  • Typoscript – JavaScript im Footer auslagern
  • Typo3 – tt_news Dokument speichern und Webseite anzeigen
  • Templavoila – Maximale Bildgröße im Contentbereich
  • Typo3 – tt_news cache deaktivieren
Blog Archiv
  • Typo3 – Auslagern von Typoscript in externe Datei
  • Typo3 – Einbinden von canonical Tag
  • Typo3 – Browserweiche (Conditional Comments)
  • Typo3 – onfocus=”blurLink(this)” in Sitemaps entfernen
  • Typo3 – Sitemap target definieren
Tutorials Archiv

27th November, 2009

WordPress Attachments (Dateianhänge)

0 comments

Wordpress Attachments
Hier ein einfacher Code-Schnipsel, um Attachments (Dateianhänge) in einem WordPress-Theme anzuzeigen.

$args = array(
	'post_type' => 'attachment',
	'numberposts' => null,
	'post_status' => null,
	'post_parent' => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
	foreach ($attachments as $attachment) {
		echo apply_filters('the_title', $attachment->post_title);
		the_attachment_link($attachment->ID, false);
	}
}

Fügt einfach den folgenden Code innerhalb eines WordPress Loops ein und deine Dateianhänge werden angezeigt.
Desweiteren ist es auch möglich den Code irgendwo in die post.php Datei einzufügen.

Credit: wprecipes.com

Tags: attachment, wordpress

Kategorie wordpress | 0 comments



RSS
Follow me on Twitter

About this blog

This website was developed by Markus Bäck based in Tutzing (Starnberger See) using XHTML, CSS, JavaScript and PHP, handcoded in Notepad++. Powered by the Almighty Wordpress.

Resources

  • CSS-Tricks
  • faktor23.de
  • Smashing Magazine

Blogroll

  • Oxid Freelancer
  • TYPO3 Agentur München
  • TYPO3 Freelancer
  • TYPO3 Programmierer

Work

  • stream5 GmbH
  • Guido Schindler Delikatessen | Feinkost - Bistro - Partyservice - Starnberger See
  • ViCommerce GmbH
Copyright © 2012 just4freaks.de Designed and managed by Webdesign Starnberg