Featured Content Gallery | WordPress Plugin | iePlexus

FCG in Header.php causing pages to only show featured conten

Downloading, installing, upgrading, and configuring the FCG plugin

FCG in Header.php causing pages to only show featured conten

PostBy schleicher12000 on Wed Aug 05, 2009 1:07 pm

When I put the
Code: Select all
<?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?>
in my MainIndex.php page, the plug-in works fine. The Featured content appears in the window, and everything below the FCG window shows posts normally.

Image

However, in order to get the layout and design to look better and work in the way I want it, I need to move the code to the Header.php.

When I do that, the layout looks good, but the "BODY" will now only show the posts that are in the FCG

Image

There's also that werid spacing issue, but I can get that part figured out myself. The plug-in is of no use to me in this form, but it is also the best solution for what I want to do.

CAN YOU PLEASE HELP!?

Here is the Header.php code with the FCG code in place.

HEADER.PHP CODE
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">


<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

<title>Major Spoilers</title>

<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->


<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/print.css" type="text/css" media="print" />

<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />

<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<link rel="apple-touch-icon" href="http://www.majorspoilers.com/majorspoilerspicon.png">
<link rel="shortcut icon" href="http://www.majorspoilers.com/favicon.ico" type="image/x-icon" />


<script type="text/javascript" language="javascript" src="<?php bloginfo('template_directory'); ?>/js/hmenu.js"> </script>
   
<?php wp_head(); ?>

</head>

<body>


<div id="page">


   <a href="http://www.majorspoilers.com"><img src="http://www.majorspoilers.com/wp-content/themes/majorspoilers/images/squarelogo.jpg" align="left" /></a>

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

<hr />




And here is the Main Index page code

MAIN INDEX.PHP CODE
Code: Select all
<?php get_header(); ?>

<?php include( TEMPLATEPATH . '/menu.php' ); ?>


   <div id="content" class="narrowcolumn">


   <?php if (have_posts()) : ?>
   
      <?php while (have_posts()) : the_post(); ?>
            
         <div class="post" id="post-<?php the_ID(); ?>">
            <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
            <small><?php the_time('F jS, Y') ?>--by <?php the_author() ?></small>
            
            <div class="entry">
               <?php the_content('<span class="moretext"> More After the Jump &raquo;</span>'); ?>
            </div>
      
            <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p>
         </div>
   
      <?php endwhile; ?>

      <div class="navigation">
         <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
         <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
      </div>
      
   <?php else : ?>

      <h2 class="center">Not Found</h2>
      <p class="center">Sorry, but you are looking for something that isn't here.</p>
      <?php include (TEMPLATEPATH . "/searchform.php"); ?>

   <?php endif; ?>

  <?php
       if (function_exists('wp_pagebar'))
          wp_pagebar();
      ?>

   </div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>


Thanks so much to ANYONE who can help me solve this MAJOR issue.
schleicher12000
 
Posts: 11
Joined: Wed Aug 05, 2009 11:44 am

Re: FCG in Header.php causing pages to only show featured conten

Thank you for using the Featured Content Gallery Forum
 

Re: FCG in Header.php causing pages to only show featured conten

PostBy schleicher12000 on Wed Aug 05, 2009 1:09 pm

Also,
I have tried this plugin with all other plugins turned off, and I have tried FCG on the WordPress Default Theme with the same results.
schleicher12000
 
Posts: 11
Joined: Wed Aug 05, 2009 11:44 am

Re: FCG in Header.php causing pages to only show featured conten

PostBy schleicher12000 on Sat Aug 08, 2009 11:03 am

Just an update. I tried switching from Category posting to pages and page ID numbers, and it did fix the issue. HOWEVEr, I need to use category in order for FCG to work effectively on my site.

Still waiting for help from the techies on this one.

PLEASE!
schleicher12000
 
Posts: 11
Joined: Wed Aug 05, 2009 11:44 am

Re: FCG in Header.php causing pages to only show featured conten

PostBy admin on Mon Aug 10, 2009 7:56 am

url?
Yelena Khamidullina
Web Applications Developer, iePlexus

1. Check settings to exclude fcg-YOU conflict
2. Try to turn off all your plugins at once to exclude fcg-other plugin conflict
3. Try default theme to exclude fcg-theme conflict
4. Post in this forum to involve me in your troubleshooting. URL is required
User avatar
admin
Site Admin
 
Posts: 3368
Joined: Fri Jan 16, 2009 9:29 am
Location: Seattle, WA

Re: FCG in Header.php causing pages to only show featured conten

PostBy schleicher12000 on Mon Aug 10, 2009 8:10 am

schleicher12000
 
Posts: 11
Joined: Wed Aug 05, 2009 11:44 am

Re: FCG in Header.php causing pages to only show featured conten

PostBy pgrandstaff on Wed Aug 12, 2009 8:02 am

I was having something like this, fixed it by adding one line to gallery.php
Code: Select all
$wp_query->rewind_posts();

I put it on line 44 before
Code: Select all
}
else { ?>

and after
Code: Select all
</div>
<?php


Hope that helps.
pgrandstaff
 
Posts: 4
Joined: Sun Jul 05, 2009 5:37 pm

Re: FCG in Header.php causing pages to only show featured conten

PostBy schleicher12000 on Wed Aug 12, 2009 8:47 am

The closest line I found with that code was line 55.

Here is the gallery.php code from lines 19 - 60 with the bit of code you suggest at line 52

Code: Select all
    <div id="myGallery">
    <?php
    $imgthumb = get_option('gallery-use-thumb-image') ? "thumbnailimg" : "articleimg";
    $wordquantity = get_option('gallery-rss-word-quantity') ?  get_option('gallery-rss-word-quantity') : 100;
    if (get_option('gallery-way') == 'new')   {//new way
          $arr = split(",",get_option('gallery-items-pages'));
          if (get_option('gallery-randomize-pages'))
          {
              shuffle($arr);
          }
          foreach ($arr as $post_or_page_id)   
          {
             get_a_post($post_or_page_id); ?>
             <div class="imageElement">
                <h2><?php the_title() ?></h2>
                <?php
                  if(get_option('gallery-use-featured-content')) {?>
                    <p><?php $key="featuredtext"; echo get_post_meta($post->ID, $key, true); ?></p>
                 <?php
                 } else {
                 ?>
                    <p><?php the_content_rss('', 0, '', $wordquantity); ?></p>
                 <?php
                  }
                  ?>
                 <a href="<?php the_permalink() ?>" title="Read More" class="open"></a>
                 <img src="<?php $key="articleimg"; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php $key="alttext"; echo get_post_meta($post->ID, $key, true); ?>" class="full" />
                 <img src="<?php $key=$imgthumb; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php $key="alttext"; echo get_post_meta($post->ID, $key, true); ?>" class="thumbnail" />
              </div>
          <?php
          } ?>
        </div>
        <?php
$wp_query->rewind_posts();
}
     else { ?>
       <?php $temp_query = $wp_query; ?>
       <?php query_posts('category_name=' . get_option('gallery-category') . '&showposts=' . get_option('gallery-items')); ?>
       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
          <div class="imageElement">
            <h2><?php the_title() ?></h2>


Is that where you were suggesting? If so, that didn't work :(
schleicher12000
 
Posts: 11
Joined: Wed Aug 05, 2009 11:44 am

Re: FCG in Header.php causing pages to only show featured conten

PostBy pgrandstaff on Wed Aug 12, 2009 9:46 am

Yeah, that looks like the right spot. Guess our problems aren't identical. It does look like a loop issue. Have you tried specifying featured content by individual ID's and by category in the plugin settings? I was using specific ID's, and that's the section of gallery.php I edited. Selecting by category executes a different section of code in gallery.php Maybe one or the other will work for you.

Here's my entire gallery.php if you want to try it.
Code: Select all
<div id="featured">
   <script type="text/javascript">
        function startGallery() {
            var myGallery = new gallery($('myGallery'), {
                timed: true
            });
        }
        window.addEvent('domready',startGallery);
    </script>
   
    <div id="myGallery">
    <?php
    $imgthumb = get_option('gallery-use-thumb-image') ? "thumbnailimg" : "articleimg";
    $wordquantity = get_option('gallery-rss-word-quantity') ?  get_option('gallery-rss-word-quantity') : 100;
    if (get_option('gallery-way') == 'new')   {//new way
          $arr = split(",",get_option('gallery-items-pages'));
          if (get_option('gallery-randomize-pages'))
          {
              shuffle($arr);
          }
          foreach ($arr as $post_or_page_id)   
          {
             get_a_post($post_or_page_id); ?>
             <div class="imageElement">
                <h2><?php the_title() ?></h2>
                <?php
                  if(get_option('gallery-use-featured-content')) {?>
                    <p><?php $key="featuredtext"; echo get_post_meta($post->ID, $key, true); ?></p>
                 <?php
                 } else {
                 ?>
                    <p><?php the_content_rss('', 0, '', $wordquantity); ?></p>
                 <?php
                  }
                  ?>
                 <a href="<?php the_permalink() ?>" title="Read More" class="open"></a>
                 <img src="<?php $key="articleimg"; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php $key="alttext"; echo get_post_meta($post->ID, $key, true); ?>" class="full" />
                 <img src="<?php $key=$imgthumb; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php $key="alttext"; echo get_post_meta($post->ID, $key, true); ?>" class="thumbnail" />
              </div>
          <?php
          } ?>
        </div>
        <?php
      $wp_query->rewind_posts(); // by PG to fix broken loop after FCG
     }
     else { ?>
       <?php $temp_query = $wp_query; ?>
       <?php query_posts('category_name=' . get_option('gallery-category') . '&showposts=' . get_option('gallery-items')); ?>
       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
          <div class="imageElement">
            <h2><?php the_title() ?></h2>
            <?php
                  if(get_option('gallery-use-featured-content')) {?>
                    <p><?php $key="featuredtext"; echo get_post_meta($post->ID, $key, true); ?></p>
                 <?php
                 } else {
                 ?>
                    <p><?php the_content_rss('', 0, '', $wordquantity); ?></p>
                 <?php
                  }
                  ?>
                 <a href="<?php the_permalink() ?>" title="Read More" class="open"></a>
                 <img src="<?php $key="articleimg"; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php $key="alttext"; echo get_post_meta($post->ID, $key, true); ?>" class="full" />
                 <img src="<?php $key=$imgthumb; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php $key="alttext"; echo get_post_meta($post->ID, $key, true); ?>" class="thumbnail" />
         </div>
         <?php endwhile; else: ?>
         <?php endif; ?>
         <?php $wp_query = $temp_query; ?>
       </div>
     <?php
     }?>
   
</div>
pgrandstaff
 
Posts: 4
Joined: Sun Jul 05, 2009 5:37 pm

Re: FCG in Header.php causing pages to only show featured conten

PostBy schleicher12000 on Wed Aug 12, 2009 6:37 pm

As mentioned above, I have tried this with individual post IDs, and everything works fine. It is the category name that causes the problem. While it might be very easy to say "Well use the POST ID, and your problem is solved" it's not that easy as we generate quite a bit of content, that having to go into the plug-in multiple times per day to add/remove POST IDs makes the plug-in not that useful.

If this problem can be fixed, I'd jump up an down with joy, but alas, it looks like there may not be a solution... or is there?
schleicher12000
 
Posts: 11
Joined: Wed Aug 05, 2009 11:44 am

Re: FCG in Header.php causing pages to only show featured conten

PostBy schleicher12000 on Wed Aug 12, 2009 6:48 pm

I also tried your code, and had the same problem.
schleicher12000
 
Posts: 11
Joined: Wed Aug 05, 2009 11:44 am

Next

Return to Getting Started

Who is online

Users browsing this forum: No registered users and 0 guests