also die sidebar-frage hab ich hinbekommen. nun gilt es, den ersten beitrag gesondert hinzubekommen, wie auf dem Bild - wer kann helfen???
Beiträge von Dailybloggger
-
-
vielen dank! es geht um beide. ich möchte das am ende so aussehen lassen:
http://dailyimpulse.files.wordpress.com/2011/06/bild-1-2.jpg
Das heißt, ich möchte den ersten Beitrag gesondert mit eigenen css einstellungen (größeres bild, excerpt rechts statt untendrunter) haben. Auf den nächsten Seiten sollen dann einfach drei Beiträge nebeneinander stehen (also nur der wirklich allerneuste artikel soll größer erscheinen) - weißt du da auch, wie ich das anstellen kann?
-
Hier mein Blog:
http://www.dailyimpulse.deIch hab da immer 2 beiträge nebeneinander, möchte aber gerne 3 nebeneinander und die sidebar soll nur bei den einzelbeiträgen erscheinen...
hier die loop:PHP
Alles anzeigen<?php /** * @package WordPress * @subpackage Coraline * @since Coraline 1.0 */ ?> <?php /* If there are no posts to display, such as an empty archive page */ ?> <?php if ( ! have_posts() ) : ?> <div id="post-0" class="post error404 not-found"> <h1 class="entry-title"><?php _e( 'Not Found', 'coraline' ); ?></h1> <div class="entry-content"> <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'coraline' ); ?></p> <?php get_search_form(); ?> </div><!-- .entry-content --> </div><!-- #post-0 --> <?php endif; ?> <?php // Start the Loop. $options = get_option( 'coraline_theme_options' ); while ( have_posts() ) : the_post(); ?> <?php /* How to display posts in the Gallery category. */ ?> <?php if ( isset( $options['gallery_category'] ) && '0' != $options['gallery_category'] && in_category( $options['gallery_category'] ) ) : ?> <div id="post-<?php the_ID(); ?>" <?php post_class( 'category-gallery' ); ?>> <h2 class="excerpt-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'coraline' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <div class="entry-meta"> <?php coraline_posted_on(); ?> </div><!-- .entry-meta --> <div class="entry-content"> <?php if ( post_password_required() ) : ?> <?php the_content(); ?> <?php else : ?> <?php $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) ); if ( $images ) : $total_images = count( $images ); $image = array_shift( $images ); $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' ); ?> <div class="gallery-thumb"> <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a> </div><!-- .gallery-thumb --> <p><em><?php printf( __( 'This gallery contains <a %1$s>%2$s photos</a>.', 'coraline' ), 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'coraline' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"', $total_images ); ?></em></p> <?php endif; ?> <?php the_excerpt(); ?> <?php endif; ?> </div><!-- .entry-content --> <div class="entry-info"> <span class="comments-link"><?php comments_popup_link( __( '→ Leave a comment', 'coraline' ), __( '→ 1 Comment', 'coraline' ), __( '→ % Comments', 'coraline' ) ); ?></span> <p><a href="<?php echo get_term_link( $options['gallery_category'], 'category' ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'coraline' ); ?>"><?php _e( 'More Galleries', 'coraline' ); ?></a></p> <p><?php edit_post_link( __( 'Edit', 'coraline' ), '', '' ); ?></p> </div><!-- .entry-info --> </div><!-- #post-## --> <?php /* How to display posts in the asides category */ ?> <?php elseif ( isset( $options['aside_category'] ) && '0' != $options['aside_category'] && in_category( $options['aside_category'] ) ) : ?> <div id="post-<?php the_ID(); ?>" <?php post_class( 'category-asides' ); ?>> <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?> <div class="entry-summary aside"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="entry-content aside"> <?php the_content( __( 'Read more <span class="meta-nav">→</span>', 'coraline' ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <div class="entry-info"> <p class="comments-link"><?php comments_popup_link( __( '→ Leave a comment', 'coraline' ), __( '→ 1 Comment', 'coraline' ), __( '→ % Comments', 'coraline' ) ); ?></p> <p><?php coraline_posted_on(); ?></p> <?php edit_post_link( __( 'Edit', 'coraline' ), '', '' ); ?> </div><!-- .entry-info --> </div><!-- #post-## --> <?php /* How to display all other posts. */ ?> <?php else : ?> <?php $halfstyle = ($counter%2 == 0) ? 'left-half' : 'right-half'; $counter++; //EDIT: for two columns ?> <div id="post-<?php the_ID(); ?>" <?php post_class($halfstyle); ?>> <div class="featured-image"><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_post_thumbnail (); ?><class="attachment-post-thumbnail wp-post-image" /></a> </div><!-- .featured-image --> <h2 class="excerpt-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'coraline' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <?php if ( is_search() ) : // Display excerpts for search. ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="excerpt"> <?php the_excerpt( __( 'Read more <span class="meta-nav">→</span>', 'coraline' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'coraline' ), 'after' => '</div>' ) ); ?> </div><!-- .excerpt --> <?php endif; ?> </div><!-- #post-## --> <?php comments_template( '', true ); ?> <?php endif; // This was the if statement that broke the loop into three parts based on categories. ?> <?php endwhile; // End the loop. Whew. ?> a <?php if(function_exists('wp_page_numbers')) : wp_page_numbers(); endif; ?>Wäre suuuper toll wenn mir jemand weiterhelfen könnte...:-P
-
Nun möchte ich es doch anders: Wie bekomme ich drei statt zwei Beiträge nebeneinander?
-
also das plugin "Random Excerpts fader" ist ja ganz schön, aber zeigt leider keine thumbnails an...kann ich das irgendwie selbst einfügen? hier der php-code des plugins:
PHP
Alles anzeigen<?php /* Plugin Name: Random Excerpts Fader Plugin URI: http://www.jackreichert.com/2010/09/random-excerpts-fader/ Description: Creates a widget that takes randomly a number of excerpts from a category of your choice and fades them in and out. Perfect for displaying testimonials. Version: 1.2.6 Author: Jack Reichert Author URI: http://www.jackreichert.com/about License: GPLv2 Copyright 2010 Jack Reichert (email : contact@jackreichert.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, visit http://codex.wordpress.org/GPL or write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class reFader extends WP_Widget { function reFader() { // The widget construct. Initiating our plugin data. $widgetData = array( 'classname' => 'reFader', 'description' => __( 'Display excerpts from a category of your choice and fades them in and out... jQuery Style!' ) ); $this->WP_Widget('reFader', __('Random Excerpts Fader'), $widgetData); } function widget($args, $instance) { // Displays the widget on the screen. extract($args); echo $before_widget; echo $before_title . $instance['title'] . $after_title; $this->RandomExcerptsFader($instance); echo $after_widget; } function update($new_instance, $old_instance) { // Updates the settings. return $new_instance; } function form($instance) { // The admin form. $defaults = array( 'title' => 'Random Excerpts' ,'amount' => 5, 'cat' => 0, 'length' => 50, 'duration' => 5000, 'linked'=>'no'); $instance = wp_parse_args($instance, $defaults); $ref_categories = get_categories('hide_empty=0'); foreach ( $ref_categories as $c ) { $ref_cat[] = array( $c->cat_ID, $c->cat_name ); }?> <div id="reFader-admin-panel"> <p> <label for="<?php echo $this->get_field_id('title'); ?>">Widget title:</label> <input type="text" class="widefat" name="<?php echo $this->get_field_name('title'); ?>" id="<?php echo $this->get_field_id('title'); ?>" value="<?php echo $instance['title']; ?>" /> </p> <p> <select name="<?php echo $this->get_field_name('cat'); ?>" id="<?php echo $this->get_field_id('cat'); ?>"> <option value="-1" <?php if ($instance['cat'] == '-1') { echo 'selected="true"'; } ?>>All Categories</option> <?php foreach( $ref_cat as $cat ) { $extra = ""; if( $instance['cat'] == $cat[0] ) { $extra = 'selected'; } echo '<option value="'.$cat[0].'" '.$extra.'>'.$cat[1]."</option>\n"; } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('amount'); ?>">Number of posts:</label> <input type="text" size="2" name="<?php echo $this->get_field_name('amount'); ?>" id="<?php echo $this->get_field_id('amount'); ?>" value="<?php echo $instance['amount']; ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('length'); ?>">Excerpt Word Length:</label> <input type="text" size="3" name="<?php echo $this->get_field_name('length'); ?>" id="<?php echo $this->get_field_id('length'); ?>" value="<?php echo $instance['length']; ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('duration'); ?>">Fade duration:</label> <input type="text" size="5" name="<?php echo $this->get_field_name('duration'); ?>" id="<?php echo $this->get_field_id('duration'); ?>" value="<?php echo $instance['duration']; ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('linked'); ?>">Link title to post?</label> <input type="checkbox" name="<?php echo $this->get_field_name('linked'); ?>" id="<?php echo $this->get_field_id('linked'); ?>" value="yes" <?php echo (($instance['linked']=='yes')?'checked="checked"':''); ?> /> </p> </div> <?php } function truncWords($string, $words = 55) { //creates custom size excerpt $string = explode(' ', strip_tags($string)); if (count($string) > $words) { return implode(' ', array_slice($string, 0, $words)); } return implode(' ', $string); } function RandomExcerptsFader($instance) { // gets the posts ?> <div id="RandomExcerpts"> <?php $excerpts = get_posts('showposts='.$instance['amount'].'&cat='.$instance['cat'].'&orderby=rand'); foreach($excerpts as $excerpt) : ?> <p class="hide">"<?php echo $this->truncWords($excerpt->post_content, $instance['length']); ?>"<br /> <span class="testimonial-title"><?php echo (($instance['linked']=='yes') ? '<a href="'.get_permalink($excerpt->ID).'">'.$excerpt->post_title.'</a>' : $excerpt->post_title); ?></span></p> <?php endforeach; ?> <div id="duration"><?php echo $instance['duration']; ?></div> </div> <?php } } // Register the widget. add_action('widgets_init', create_function('', 'return register_widget("reFader");')); wp_enqueue_script("jquery"); wp_enqueue_script('reFader_js', WP_PLUGIN_URL.'/random-excerpts-fader/RandomExcerptsFader.js', array('jquery')); wp_register_style('reFaderStylesheet', WP_PLUGIN_URL . '/random-excerpts-fader/RandomExcerptsFader.css'); wp_enqueue_style( 'reFaderStylesheet'); ?> -
ich suche ein Plugin für eine Slideshow in der Sidebar. Darin sollen alle feature images in zufälliger (!) reihenfolge abgespielt werden. finde nur welche, die chronologisch ordnen oder di eine bidlerbegrenzung haben....wäre echt toll wenn jemand was weiß, ich finde einfach nichts...v:confused:
-
juppiii, das hat funktioniert!! vielen vielen vielen dank!!!
-
-
Bin schon ein gute Stück weiter, aber ich bekomme die Zahlen einfach nicht automatisch zentriert. sie orientieren sich immernoch nach der linken Seite...bitte schaut euch das mal an, vll kann mir ja doch jemand weiterhelfen..
-
Ich habe auf meinem Blog das Plugin wp-page numbers installiert. das problem dabei ist, dass die zahlen ständig innerhalb des "plugin-feldes" hin und her springen. was muss ich tun, um sie automatisch zu zentrieren? Sie müssen sich wirklich AUTOMATISCH zentrieren, da sie ja z.b. die zahlen 123 weniger platz benötigen als die zahlen 11 12 13....habs schon mit margin-left: auto und margin-right: auto und text-align: center versucht, bringt alles nichts...
BITTE helft mir :razz:
-
Niemand?
Auf den Seiten 1-4 sitzen die Zahlen da wo sie sollen..http://www.dailyimpulse.de/
Aber auf Seite 5 rutschen sie nach rechts und in zwei zeilen.....wer kann mir sagen, woran das liegt??? -
ich verzweifel gerade an dem plugin "WP page numbers". Ich habde den Code des Plugins in meine Loop eingebaut und da gehts schon los: Hab ich das an die richtige Stelle gesetzt? Es ist die allerletzte Zeile...
PHP
Alles anzeigen<?php /** * @package WordPress * @subpackage Coraline * @since Coraline 1.0 */ ?> <?php /* If there are no posts to display, such as an empty archive page */ ?> <?php if ( ! have_posts() ) : ?> <div id="post-0" class="post error404 not-found"> <h1 class="entry-title"><?php _e( 'Not Found', 'coraline' ); ?></h1> <div class="entry-content"> <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'coraline' ); ?></p> <?php get_search_form(); ?> </div><!-- .entry-content --> </div><!-- #post-0 --> <?php endif; ?> <?php // Start the Loop. $options = get_option( 'coraline_theme_options' ); while ( have_posts() ) : the_post(); ?> <?php /* How to display posts in the Gallery category. */ ?> <?php if ( isset( $options['gallery_category'] ) && '0' != $options['gallery_category'] && in_category( $options['gallery_category'] ) ) : ?> <div id="post-<?php the_ID(); ?>" <?php post_class( 'category-gallery' ); ?>> <h2 class="excerpt-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'coraline' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <div class="entry-meta"> <?php coraline_posted_on(); ?> </div><!-- .entry-meta --> <div class="entry-content"> <?php if ( post_password_required() ) : ?> <?php the_content(); ?> <?php else : ?> <?php $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) ); if ( $images ) : $total_images = count( $images ); $image = array_shift( $images ); $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' ); ?> <div class="gallery-thumb"> <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a> </div><!-- .gallery-thumb --> <p><em><?php printf( __( 'This gallery contains <a %1$s>%2$s photos</a>.', 'coraline' ), 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'coraline' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"', $total_images ); ?></em></p> <?php endif; ?> <?php the_excerpt(); ?> <?php endif; ?> </div><!-- .entry-content --> <div class="entry-info"> <span class="comments-link"><?php comments_popup_link( __( '→ Leave a comment', 'coraline' ), __( '→ 1 Comment', 'coraline' ), __( '→ % Comments', 'coraline' ) ); ?></span> <p><a href="<?php echo get_term_link( $options['gallery_category'], 'category' ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'coraline' ); ?>"><?php _e( 'More Galleries', 'coraline' ); ?></a></p> <p><?php edit_post_link( __( 'Edit', 'coraline' ), '', '' ); ?></p> </div><!-- .entry-info --> </div><!-- #post-## --> <?php /* How to display posts in the asides category */ ?> <?php elseif ( isset( $options['aside_category'] ) && '0' != $options['aside_category'] && in_category( $options['aside_category'] ) ) : ?> <div id="post-<?php the_ID(); ?>" <?php post_class( 'category-asides' ); ?>> <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?> <div class="entry-summary aside"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="entry-content aside"> <?php the_content( __( 'Read more <span class="meta-nav">→</span>', 'coraline' ) ); ?> </div><!-- .entry-content --> <?php endif; ?> <div class="entry-info"> <p class="comments-link"><?php comments_popup_link( __( '→ Leave a comment', 'coraline' ), __( '→ 1 Comment', 'coraline' ), __( '→ % Comments', 'coraline' ) ); ?></p> <p><?php coraline_posted_on(); ?></p> <?php edit_post_link( __( 'Edit', 'coraline' ), '', '' ); ?> </div><!-- .entry-info --> </div><!-- #post-## --> <?php /* How to display all other posts. */ ?> <?php else : ?> <?php $halfstyle = ($counter%2 == 0) ? 'left-half' : 'right-half'; $counter++; //EDIT: for two columns ?> <div id="post-<?php the_ID(); ?>" <?php post_class($halfstyle); ?>> <div class="featured-image"><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_post_thumbnail (); ?><class="attachment-post-thumbnail wp-post-image" /></a> </div><!-- .featured-image --> <h2 class="excerpt-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'coraline' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <?php if ( is_search() ) : // Display excerpts for search. ?> <div class="entry-summary"> <?php the_excerpt(); ?> </div><!-- .entry-summary --> <?php else : ?> <div class="excerpt"> <?php the_excerpt( __( 'Read more <span class="meta-nav">→</span>', 'coraline' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'coraline' ), 'after' => '</div>' ) ); ?> </div><!-- .excerpt --> <?php endif; ?> </div><!-- #post-## --> <?php comments_template( '', true ); ?> <?php endif; // This was the if statement that broke the loop into three parts based on categories. ?> <?php endwhile; // End the loop. Whew. ?> <?php if(function_exists('wp_page_numbers')) : wp_page_numbers(); endif; ?>In der "Anleitung" des Plugins steht:
Add the code where you find previous_post() and next_post() functions. If you can't find these tags, place the code between endwhile; and endif; in the_loop.
Code to add in your theme <?php if(function_exists('wp_page_numbers')) : wp_page_numbers(); endif; ?>
Im Firebug sehe ich, dass sich die Navigation über ganzen Content erstreckt statt nur auf die Zeile, in der die Zahlen stehen. Ich möchte das ganze Ding gerne zentriert haben und hätte nicht gedacht dass das so ein problem ist...wer kann helfen??? :?: -
juppiiiii, vielen dank, das funktioniert!!! so langsam sieht mein blog ja wieder ganz ansehnlich aus :)
-
habs eingefügt, ändert aber leider gar nichts..:-(
-
erstmal danke, aber das entfernt doch dann bei allen bilder (also auch auf den einzelen artikelseiten, also in der single.php) die titel oder? weil das wiederum möchte ich nicht...ich will dass sie nur bei den feature images (die ich separat hochgeladen habe) ausgeblendet werden...
-
hä, dann hab ich dich falsch verstanden - ich hab das erst nach deinem ersten hinweis reingemacht. habs wieder rausgemacht, wird immernoch angezeigt.
-
Hab ich alles schon versucht, ändert sich nichts. titel erscheint immernoch (vielleicht ist es auch die Bildbeschreibung? Hab beides angegeben..
Loop:
<div class="featured-image"><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_post_thumbnail (); ?><class="attachment-post-thumbnail wp-post-image" alt="More" title="More" /></a>
</div><!-- .featured-image --> -
Ausserdem will ich ja nur die Bildtitel auf den Home Seiten ausblenden, im einzelnen Artikel haben die Bilder ja ihre Alt-Tags. Aber ich komme mit deinem Code nicht klar, habs jetzt so umgeschrieben (am ende will ich aber dass da auch nicht "more" sondern einfach gar nichts steht, also auch kein alt-tag-feld erscheint)
PHP<div class="featured-image"><a href="<?php the_permalink(); ?> " title="<?php printf( esc_attr__( 'Permalink to %s', 'coraline' ), the_title_attribute( 'echo=0' ) ); ?>"rel="bookmark"><?php the_post_thumbnail (); ?><class="attachment-post-thumbnail wp-post-image" alt="More" title="More" /></a> </div><!-- .featured-image -->aber bringt nichts...kannst du mir da nochmal unter die arme greifen :lol:
-
Ok danke, probier ich gleich aus...aber zur suchmaschine: meine bilder haben doch schon einen titel und eine beschreibung (die genauso lauten wie der angezeigte text) - also brauch ich den doch nicht nochmal extra oder?
-
sowas wird doch nicht in css gemacht, oder? wenn du eine möglichkeit weißt, her damit :)