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 WebWeaver on Wed May 12, 2010 4:57 pm

Hi there-

I copied all of this code and replaced it in my gallery.php file, but I got a parsing error in Line 21. Was I only supposed to replace part of the code? This is in reference to http://mrsasecret.com/ where the home page is showing an archive of the featured content erroneously.
Thanks, WebWeaver

Code: Select all
[quote]
here I post the code for gallery.php that you need to replace..[code]<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>
[/quote]
WebWeaver
 
Posts: 14
Joined: Wed May 13, 2009 12:02 pm
Location: Nevada City, CA

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 admin on Thu May 13, 2010 8:10 am

you need to upload gallery plugin, then put the gallery call in index.php or home.php..
you should not copy any gallery.php code anywhere
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: 4738
Joined: Fri Jan 16, 2009 9:29 am
Location: Seattle, WA

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

PostBy WebWeaver on Thu May 13, 2010 8:32 am

Thanks Yelena, however, I think you misunderstood my reply. To clarify: I widgetized the header, installed the PHP code widget plugin and placed this code in the widget:

<?php global $post; include(WP_CONTENT_DIR . '/plugins/featured-content-gallery/gallery.php'); ?>

as suggested previously by a user in this thread of posts. With this new call to the FCG plugin in the widget, the home page is still bringing up a page of the featured content archives instead of the static home page I created, so I still have a problem.

How exactly do I adjust gallery.php to fix this? Yesterday I took the code you suggested previously and replaced the entire originial gallery.php with it, but that gave me a parsing error in line 21.

I hope I have made the situation clear.

Thank you for you help,

-WebWeaver
site url: http://mrsasecret.com
WebWeaver
 
Posts: 14
Joined: Wed May 13, 2009 12:02 pm
Location: Nevada City, CA

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

PostBy admin on Thu May 13, 2010 9:10 am

sorry, I misunderstood you..
could you provide the error you are getting, the whole sentence
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: 4738
Joined: Fri Jan 16, 2009 9:29 am
Location: Seattle, WA

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

PostBy WebWeaver on Thu May 13, 2010 11:26 am

Guess what?! I re-placed the code you provided just to make sure the error wasn't mine, and it worked! I must have screwed it up the first time. You can delete my posts from this thread if you want. It's working fine now!

Sorry to trouble you!!

-WebWeaver
WebWeaver
 
Posts: 14
Joined: Wed May 13, 2009 12:02 pm
Location: Nevada City, CA

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

PostBy admin on Thu May 13, 2010 11:50 am

good job!!
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: 4738
Joined: Fri Jan 16, 2009 9:29 am
Location: Seattle, WA

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

PostBy algreg on Fri Jan 14, 2011 2:33 pm

everyone says that the code on the previous page works wonders. I would like to use that code too. But I don't have anything that says gallery.php when I go into Editor. Can you help?

My url is

http://can-i-save-my-relationship.com

Thanks.
algreg
 
Posts: 3
Joined: Thu Jan 13, 2011 5:35 pm

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

PostBy admin on Fri Jan 14, 2011 3:51 pm

edit plugin, not theme..
of you can do it through ftp
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: 4738
Joined: Fri Jan 16, 2009 9:29 am
Location: Seattle, WA

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

PostBy algreg on Tue Jan 18, 2011 2:34 pm

That code works wonders. Thanks a lot.
algreg
 
Posts: 3
Joined: Thu Jan 13, 2011 5:35 pm

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

PostBy admin on Tue Jan 18, 2011 4:20 pm

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: 4738
Joined: Fri Jan 16, 2009 9:29 am
Location: Seattle, WA

PreviousNext

Return to Getting Started

Who is online

Users browsing this forum: No registered users and 0 guests