Wordpress and Webdesign Forum go41 » WordPress Code Snippets

  1. omerkhan01
    Member

    Hey Joern,

    Thanks for the great tip about renaming featured o to arthfeatured. That allowed the fCG to float to the left. Anyways as you can see it is now covering the headline thumb and excerpt and below it appeared a featured post.

    How do you make sure that you move the headline post/thumb below it and also remove the featured post from showing?

    Thanks

    Omar

    Posted 1 year ago #
  2. your headline image is not in div 'headline' anymore...

    check the source code of your site, you put the gallery in front of

    <?php the_title(); ?>

    it seems for me.

    When I said put it in front of the title I didn't mean into the title tag of a link, I mean in front of div class="title".
    Actually it should be outside this headline loop, before

    <?php query_posts("showposts=1&category_name=Headline"); ?>

    or after the next

    <?php endwhile; ?>
    Posted 1 year ago #
  3. omerkhan01
    Member

    jOERN,

    My headline image/text disappear and one of my featured posts takes place of it in the headline div region.

    Look here

    Here is my index.php code including the FCG insertion code

    <?php get_header(); ?>

    <?php if(!is_paged()) { ?>

    <div id="top" class="clearfloat">

    <div id="headline">
    <img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/headline.png" width="75px" height="21px" alt="" />

    <?php query_posts("showposts=1&category_name=Headline"); ?>
    <?php while (have_posts()) : the_post(); ?>

    <div class="title">" rel="bookmark"><?php the_title(); ?></div>

    <?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?>

    <div class="meta">[<?php the_time('j M Y') ?> | <?php comments_popup_link('No Comment', 'One Comment', '% Comments');?> | <?php if(function_exists('the_views')) { the_views(); } ?>]</div>

    <?php $values = get_post_custom_values("Headline");?>
    " rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php
    $values = get_post_custom_values("Image"); echo $values[0]; ?>&w=300&h=275&zc=1&q=100"
    alt="<?php the_title(); ?>" class="left" width="300px" height="275px" />

    <?php the_excerpt(); ?>
    " rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read the full story »
    <?php endwhile; ?>

    </div>

    <div id="arthfeatured">

    <img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/featured.png" width="72px" height="17px" alt="" />

    <?php query_posts("showposts=4&category_name=Featured"); $i = 1; ?>

    <?php while (have_posts()) : the_post(); ?>
    <div class="clearfloat">
    <?php $values = get_post_custom_values("Image");
    if (isset($values[0])) { ?>
    " rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php
    $values = get_post_custom_values("Image"); echo $values[0]; ?>&w=100&h=65&zc=1&q=100"
    alt="<?php the_title(); ?>" class="left" width="100px" height="65px" />

    <?php } ?>
    <div class="info">" rel="bookmark" class="title"><?php the_title(); ?>
    <div class="meta">[<?php the_time('j M Y') ?> | <?php comments_popup_link('No Comment', 'One Comment', '% Comments');?> | <?php if(function_exists('the_views')) { the_views(); } ?>]</div>

    </div>
    </div>

    <?php endwhile; ?>

    </div>

    </div>

    <div id="middle" class="clearfloat">
    <img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/category.png" class="clearfloat" alt="" />
    <?php $display_categories = array(5,6,7,8,11); $i = 1;
    foreach ($display_categories as $category) { ?>

    <div id="cat-<?php echo $i; ?>" class="category">
    <?php query_posts("showposts=1&cat=$category")?>
    <span class="cat_title">"><?php single_cat_title(); ?></span>
    "><?php echo category_description($category); ?>
    </div>

    <?php $i++; ?>
    <?php } ?>

    </div>

    <?php } ?>

    <div id="bottom" class="clearfloat">

    <div id="front-list">

    <?php
    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("cat=-27,-28&paged=$page&posts_per_page=5"); ?>

    <?php while (have_posts()) : the_post(); ?>

    <div class="clearfloat">
    <h3 class=cat_title><?php the_category(', '); ?> &raquo</h3>
    <div class="title">" rel="bookmark"><?php the_title(); ?></div>
    <div class="meta">[<?php the_time('j M Y') ?> | <?php comments_popup_link('No Comment', 'One Comment', '% Comments');?> | <?php if(function_exists('the_views')) { the_views(); } ?>]</div>

    <div class="spoiler">
    <?php $values = get_post_custom_values("Image");
    if (isset($values[0])) { ?>
    " rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php
    $values = get_post_custom_values("Image"); echo $values[0]; ?>&w=150&h=150&zc=1&q=100"
    alt="<?php the_title(); ?>" class="left" width="150px" height="150px" />

    <?php } ?>

    <?php the_excerpt(); ?>
    </div>

    </div>

    <?php endwhile; ?>

    <div class="navigation">
    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
    else { ?>

    <div class="right"><?php next_posts_link('Next Page »') ?></div>
    <div class="left"><?php previous_posts_link('« Previous Page') ?></div>
    <?php } ?>

    </div>

    </div>

    <?php get_sidebar(); ?>

    </div>

    <?php get_footer(); ?>

    I basically want

    The headline title
    my FCG
    and then the headline excerpt

    Lastly, if I wanted to exclude a post from the frontpage I would put
    a (-) right, can you give me the codex for it and tell me where I would insert it.

    That is about it for today. Once I get the FCG working then I can figure out the rest. Thanks a million!

    Can you quickly show me what I am doing wrong.

    Thanks

    Omar

    Posted 1 year ago #
  4. just now it shows:
    The headline title
    my FCG
    and then the headline excerpt

    there is however a problem with your div class="meta"
    it shows in source code like:
    <div class="meta"></div>[18 May 2010 |....
    means it's closing before the date and comments, don't know why

    To exclude one post from a loop you should 'continue' the loop if this post-ID occurs

    in a standard loop like this:

    <?php if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == '222' ) continue; ?>

    reads: the loop will repeat as normal and just jump the post with the ID of 222

    in Arthemia in the frontlist (lower part) the original code looks like this:

    <?php while (have_posts()) : the_post(); ?>

    modified to jump post ID 123 it should look like this

    <?php while (have_posts()) : the_post(); if( $post->ID == '123' ) continue; ?>

    It might display one post less than before

    Posted 1 year ago #
  5. omerkhan01
    Member

    Joern,

    The title is showing up for the headline post, followed by the FCG, but below it should be my headline excerpt and it's image. It is not showing up.

    Instead the headline excerpt/image is being replaced by a featured image and post content.

    Here is the screenshot

    In case you need to log into my blog. Do so here

    User: admin
    pass:ironman21

    Omar

    Posted 1 year ago #
  6. omerkhan01
    Member

    I figured it out.

    Here is what I did. The FCG works on you gong into the settings and setting what posts to display. So I saw that post 452 was the post ID of the real estate post that it displayed below the FCG container rather than the headline excerpt and it was inputted into the posts text box for the FCG to show. I simply replaced this number with the post iD of the headline post and it works now.

    Awesome.

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Join us! or log in (lost password?):