Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Manji

    (@manji)

    I 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?

    Thread Starter Manji

    (@manji)

    Thread Starter Manji

    (@manji)

    Okay 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. 🙁

    Thread Starter Manji

    (@manji)

    Doesn’t work for me
    Example:

    You can only see the date und the title when you are logged in as an admin

    Thread Starter Manji

    (@manji)

    I 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?

    Thread Starter Manji

    (@manji)

    Thank 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?

    Thread Starter Manji

    (@manji)

    Sorry 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?

Viewing 7 replies - 1 through 7 (of 7 total)