Forums

Need help on coading (2 posts)

  1. ramkich4u
    Member
    Posted 1 year ago #

    I want to show 1 post full and remains only titles...
    I have below code on my page.. please help me how to modify my code

    <div class="subNewsContainer">
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Subnews_3x8') ) : ?>
    <?php endif; ?>

    <?php if (intval($npdv_options["postCountBot3"]) > 0 ) { ?>
    <?php
    $count = 1;
    $gabquery = new WP_Query();$gabquery->query('showposts='.$npdv_options["postCountBot3"].'&cat='.$npdv_options["sub3rdCatID"]);
    while ($gabquery->have_posts()) : $gabquery->the_post();
    $key2 = 'thumbnail'; $gab_thumb = get_post_meta($post->ID, $key2, TRUE); /* Custom field thumbnail check */
    ?>
    <div class="subnewspost">
    <?php if ($count == 1) { ?><span class="titleCatName">"><?php echo get_cat_name($npdv_options["sub3rdCatID"]); ?></span><?php } ?><?php
    gab_media(array('name' => 'npdv-secondary_midcol',
    'enable_video' => '0',
    'enable_thumb' => '1',
    'media_width' => '80',
    'media_height' => '60',
    'thumb_align' => 'alignleft',
    'enable_default' => $npdv_options["enthumb_3"],
    'default_name' => 'secondary_midcol.jpg'
    ));
    ?>
    <h2 class="subnewsEntryTitle">" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></h2>
    <p><?php echo string_limit_words(get_the_excerpt(), 36); ?>…</p>
    <span class="subNewsContainerMeta"><?php the_time($npdv_options["dateFormat"]); ?> / " rel="bookmark"><?php _e('Read More »','WpAdvNewspaper'); ?><?php edit_post_link(__('Edit','WpAdvNewspaper'),' / ',''); ?></span>
    </div><!-- end of .subnewspost -->
    <?php $count++; endwhile; wp_reset_query(); ?>
    <?php } ?>
    </div>

    http://www.apnewsdaily.com

  2. duck__boy
    Member
    Posted 1 year ago #

    Hey ramkich4u. Can you please ensure that you put code in proper code tags (just highlight it and click code above the textarea you are typing in). Also, if your code is longer that about 10-12 lines it is preferable to use a pastebin as it keeps the topics tidier and easier to read.

    Once you have done this I'll have a proper look at your code.

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic