hanysafro

Přehled odpovědí

Aktuálně je na stránce zobrazen 1 příspěvek (z celkem 1)
  • Autor
    Příspěvky
  • odpověď na téma: Zkrácení příspěvku po použití funkce query.string #14301

    hanysafro
    Participant
    Web

    Děkuji za rychlou odpověď, před příkaz pro vypisování příspěvku v loop.php <?php while ( have_posts() ) : the_post(); ?> jsem napsal tento kód <?php if (is_home()) {$query_string; query_posts($query_string.’&cat=13′);} ?> Jinak jsme nic neměnil a příspěvky na úvodní stránce se mi automaticky zkrátili a náhledy nezobrazují fotky nebo videa, i když jsou jediným obsahem příspěvku. Nefunguje ani zkrácení příspěvku na určitém místě v editoru příspěvků.

    chyba by mohla být někde tady:

    <?php if ( in_category( _x(‘gallery’, ‘gallery category slug’, ‘twentyten’) ) ) : ?>

    <div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>

    <h2 class=”entry-title”>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘twentyten’ ), the_title_attribute( ‘echo=0’ ) ); ?>” rel=”bookmark”><?php the_title(); ?></h2>

    <div class=”entry-meta”>

    <?php twentyten_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”>

    “><?php echo $image_img_tag; ?>

    </div><!– .gallery-thumb –>

    <p><?php printf( __( ‘This gallery contains %2$s photos.’, ‘twentyten’ ),

    ‘href=”‘ . get_permalink() . ‘” title=”‘ . sprintf( esc_attr__( ‘Permalink to %s’, ‘twentyten’ ), the_title_attribute( ‘echo=0’ ) ) . ‘” rel=”bookmark”‘,

    $total_images

    ); ?></p>

    <?php endif; ?>

    <?php the_excerpt(); ?>

    <?php endif; ?>

    </div><!– .entry-content –>

    <div class=”entry-utility”>

    ” title=”<?php esc_attr_e( ‘View posts in the Gallery category’, ‘twentyten’ ); ?>”><?php _e( ‘More Galleries’, ‘twentyten’ ); ?>

    <span class=”meta-sep”>|</span>

    <span class=”comments-link”><?php comments_popup_link( __( ‘Leave a comment’, ‘twentyten’ ), __( ‘1 Comment’, ‘twentyten’ ), __( ‘% Comments’, ‘twentyten’ ) ); ?></span>

    <?php edit_post_link( __( ‘Edit’, ‘twentyten’ ), ‘<span class=”meta-sep”>|</span> <span class=”edit-link”>’, ‘</span>’ ); ?>

    </div><!– .entry-utility –>

    </div><!– #post-## –>

    ale zde jsme žádné úpravy neprováděl a předtím vše fungovalo.

Aktuálně je na stránce zobrazen 1 příspěvek (z celkem 1)

WordPress – novinky, návody a zajímavosti