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

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

PostBy pgrandstaff on Thu Aug 13, 2009 5:22 am

I feel sure a solution exists, just not positive what it is. I do have one more idea...

I thought I read you saying it was only category, but didn't see that bit when I was replying yesterday. You might try adding the rewind posts line towards the end of gallery.php.

Replace:
Code: Select all
         <?php $wp_query = $temp_query; ?>

with:
Code: Select all
         <?php $wp_query = $temp_query; $wp_query->rewind_posts(); ?>


Honestly, that's a shot in the dark. Hopefully the developers will chime in here. *cough* *cough*

If you end up getting it working after editing core files, like gallery.php, be sure to keep a backup of your modified copy in case an update overwrites your changes!
pgrandstaff
 
Posts: 4
Joined: Sun Jul 05, 2009 5:37 pm

Re: 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 Thu Aug 13, 2009 8:41 am

Tried that too, but alas, no fix. Thanks for the help and suggestions though.

I really hope the developers can find a solution for this...SOON!
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 Thu Aug 13, 2009 8:42 am

dear pgrandstaff
*cough* *cough*
please do not spread your germs here :P
Hopefully the developers will chime in here.

Yep I got a solution for you schleicher12000

That was interesting..I had some questions about when you put gallery call in header and use category option, all posts on home page become featured posts..and also any post you click goes to posts specified in gallery...I never knew why it does it...
After reading this powerful article http://codex.wordpress.org/The_Loop , I found what's wrong...
using
query_posts('category_name=' . get_option('gallery-category') . '&showposts=' . get_option('gallery-items'));

function make wordpress behave by the featured content gallery rules, using this query for the rest of wordpress..
so solution will be create new query object that is not gonna interfere with worpress object

here I post the code for gallery.php that you need to replace..
Code: Select all
<div id="featured">
   <script type="text/javascript">
        function startGallery() {
            var myGallery = new gallery($('myGallery'), {
                timed: true
            });
        }
        window.addEvent('domready',startGallery);
    </script>

    <style type="text/css">
   
   .jdGallery .slideInfoZone
   {
      height: <?php echo get_option('gallery-info'); ?>px;
   }
   </style>
   
    <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
     }
     else { ?>
       <?php $my_query = new WP_Query('category_name=' . get_option('gallery-category') . '&showposts=' . get_option('gallery-items'));   ?>
       <?php while ($my_query->have_posts())
          {
             $my_query->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 } ?>
       </div>
     <?php
     }?>
   
</div>
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 Thu Aug 13, 2009 9:31 am

DING! That did it! Works like it should now. WOOT! Now time to do some graphic tweaking for the site to make it all line up correctly.

THANKS SO MUCH!
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 Thu Aug 13, 2009 9:33 am

yw
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 Bryoz on Thu Aug 20, 2009 3:26 pm

Wonderful! That's nipped the problem in the bud. Thanks so much ^^
Bryoz
 
Posts: 4
Joined: Sun Jul 26, 2009 10:52 am

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

PostBy mommygeekology on Sun Sep 27, 2009 4:58 pm

Hi there! Just wanted to say thanks so much for posting this fix; I am running the Headway Theme, and through the help of this forum and another helpful post on another site (about how to get FCG running in Thesis: http://www.google.com/url?sa=t&source=web&ct=res&cd=1&url=http%3A%2F%2Fgregrickaby.com%2Fget-featured-content-gallery-to-work-in-thesis.html&ei=_AnASpKZH4jP8QaBhpjDAQ&usg=AFQjCNENlNlnHucCCscYEEx5LNRCxwEBjw&sig2=a5gAR8HA9NAxwDrafQl2GQ%20) I was able to get everything working perfectly.

In case someone else has had a similar problem with Headway:

I was experiencing an issue with the content leaf -- when I placed the code to run FCG in an HTML/Text leaf above the content leaf, and let the content leaf go with default behavior, the index page only showed the category archive for the category selected for FCG! Eek! I tried switching the content leaf behavior to posts, but then the Older and Newer post links, and WP-Navi, wouldn't work- I just got the same posts as on the 1st page, no matter what page I navigated to!

I replaced the gallery.php code with the code that was supplied above, and it fixed it! Yes!!

Another note, again just in case someone else had the same problem -- I couldn't get FCG to work with the regular php code we're given to insert, had to use
Code: Select all
<?php global $post; include(WP_CONTENT_DIR . '/plugins/featured-content-gallery/gallery.php'); ?>
instead of the standard
Code: Select all
<?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?>
.

Thanks again everyone! You're lifesavers!
mommygeekology
 
Posts: 2
Joined: Sun Sep 27, 2009 4:51 pm

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

PostBy brett7481 on Sat Mar 20, 2010 7:42 am

Hey, I was having that same problem, I tried the solution, but now I'm getting the following error:

Parse error: syntax error, unexpected T_STRING in /homel/public_html/test/wp-content/plugins/featured-content-gallery/gallery.php on line 21


URL: test.whitehillphotography.com
brett7481
 
Posts: 4
Joined: Sat Mar 20, 2010 7:40 am

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

PostBy brett7481 on Sat Mar 20, 2010 10:04 am

Got it working. I left the code the same and just moved my call of the plugin to elsewhere. Loads fine now.
brett7481
 
Posts: 4
Joined: Sat Mar 20, 2010 7:40 am

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

PostBy callmehippy on Tue Apr 20, 2010 6:57 am

Thanks for the tip. Worked perfectly.
callmehippy
 
Posts: 1
Joined: Tue Apr 20, 2010 6:55 am

PreviousNext

Return to Getting Started

Who is online

Users browsing this forum: No registered users and 0 guests