Manji
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: List all Picture in the MedialibraryI think the main problem is that guest can’t see “attachments” which are not used in any page or post. I must find a way to change user permission and it should work. Any Idea?
Forum: Fixing WordPress
In reply to: List all Picture in the Medialibraryhttp://markensalz.com/schiefelbein/?attachment_id=94
The Link above ist wrong
Forum: Fixing WordPress
In reply to: List all Picture in the MedialibraryOkay your code also worked for me, but i need a date and a title in the attachment.php
<html> <head> <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/style2.css" type="text/css" media="screen" /> </head> <body> <div style="align: center;text-align: center;"> <h2>Kollektion vom <?php the_time('d.m.Y'); ?></h2> <h4>Artikelnummer: <?php the_title(); ?></h4> <?php echo wp_get_attachment_image( $attachment_id, 'medium' ); ?> <br /><br /><br /> <img src="<?php bloginfo('template_directory'); ?>/images/logo2.jpg"> </div> </body> </html>http://markensalz.com/schiefelbein/?attachment_id=74
Logged out i can’t see the title & date of the attachment in the attachment.php. Thats my problem. I Don’t need a date in the foreach loop.
I also tried
echo 'post date' . $attachment_id->post_date;
Doenst work.Ich hope you understand what my problem is. 🙁
Forum: Fixing WordPress
In reply to: List all Picture in the MedialibraryForum: Fixing WordPress
In reply to: List all Picture in the MedialibraryI got thise code in the index.php
index.php<?php $images =& get_children( 'post_type=attachment&post_mime_type=image' ); if ( empty($images) ) { // no attachments here } else { $count =0; foreach ( $images as $attachment_id => $attachment ) { $img_title = $attachment->post_title; if($count == 4){ echo '</div></div><div style="position: relative; width: 650px; height: 160px; text-align: center;" class="jFlowSlideContainer"><div>'; $count =0; } echo wp_get_attachment_link($attachment_id, $size='thumbnail', $permalink = true); $count ++; } } ?>As you can see the attachment is opened up (with fancybox) in the single.php with this code:
single.php<html> <head> <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/style2.css" type="text/css" media="screen" /> </head> <body> <div style="align: center;text-align: center;"> <h2>Kollektion vom <?php the_time('d.m.Y'); ?></h2> <h4>Artikelnummer: <?php the_title(); ?></h4> <?php echo wp_get_attachment_image( $attachment_id, 'medium' ); ?> <br /> <img src="<?php bloginfo('template_directory'); ?>/images/logo2.jpg"> </div> </body> </html>But i only can see <?php the_time(‘d.m.Y’); ?> and <?php the_title(); ?> when i’m logged in as an admin. How can I grant acess to this site/attachment to all user?
Forum: Fixing WordPress
In reply to: List all Picture in the MedialibraryThank you very much! I have only one last question.
Can I show the date of the last uploaded attachment on the site with a template tag?
Forum: Fixing WordPress
In reply to: List all Picture in the MedialibrarySorry for the Bump.
“get_children()” Helps me much. But there some new problems.
$images =& get_children( 'post_type=attachment&post_mime_type=image' ); if ( empty($images) ) { // no attachments here } else { foreach ( $images as $attachment_id => $attachment ) { echo wp_get_attachment_image( $attachment_id, $size='thumbnail' ); } }How I can add a link to the full image?