SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Member
    Join Date
    Mar 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Php/Wordpress update triggering unknown glitch

    Hey forum. First-time poster here, so please take it easy on me .

    I've got what I believe should be a fairly simple php fix for someone with a little more expertise. But it does require a bit of explanation, so this could get long. Sorry. Here goes:

    Link:
    http://neighboragency.com/what-we-do/

    So I'm trying to add that "Client Work" piece you see at the bottom of the <ul>. Looks fine in its resting state, but check out what happens when you try to click to expand the thumbnail gallery. Somehow it triggers the next section of the site, "Who We Are", which comes up and covers the bottom half of my gallery post. (From that stage, if you click "What We Do" again on the left-side menu, the post for some reason snaps to what it IS supposed to look like in its expanded state.)

    Might help to click around on the other sections to see how everything is supposed to work. On the "Who We Are" page, for example, clicking to expand the bottom entry (Renee Carnegie) produces the desired effect of the entry pulling down to the bottom of the page and ending the scroll. It doesn't pull in the next section, "Connect", the way my problem post is pulling in "Who We Are." So I checked to make sure the code on the bottom of the "what-we-do.php" file exactly mimicked that of the "who-we-are.php" file. It does. But for whatever reason when I click to expand the bottom Below I'm pasting the code for both those pages, and below that the code for my post from within WordPress. But it should be noted that I don't think the wordpress code is a problem, because clicking on any of the menu items above the client work post produces the same effect of triggering the "who we are" page (those are eventually going to expand to display more content).

    Hopefully someone out there will have the patience to sift through all this and tell me what's going on. And I'm probably leaving out something important, so by all means please let me know what else you need to help me out. Thanks in advance!

    Code
    "What We Do" Page:


    PHP Code:
    <?php
    /**
     * The template used for displaying page content in page.php
     *
     * @package Scout
     * @since Scout 1.0
     */
    ?>
    <article id="post-<?php the_ID(); ?><?php post_class(); ?>>
        <header class="entry-header">
                <h1 class="entry-title"><?php the_title(); ?></h1>
        </header><!-- .entry-header -->

        <div class="entry-content">
            <?php the_content(); ?>
        </div><!-- .entry-content -->
        <div class="services">
            <?php wp_reset_postdata(); ?>
            <?php
            $services 
    get_posts(array('category_name' => 'Services'));
            
    $count_services count($services);
            if(
    $count_services 0){
            
    ?>
                
                <?php
                
    foreach($services as $service){
                    
    setup_postdata($service);
                
    ?>
                    
                    
                <div class="column <?php echo($service->post_name); ?>">
                    <h3 class="service-header"><?php echo $service->post_title;?></h3>
                    <div class="service-detail"><?php the_content();?></div>   
                </div>
            
            
                <?php ?>
                
            <?php ?>
        </div>

        <?php wp_reset_postdata(); ?>
        
        <h3 class="list-customers-header">AND WE DELIVER BIG OUTCOMES</h3>

        <ul id="list-members">
        <?php

            
    //The Query
            
    $items get_posts('cat=6');
            
    $count count($items);
            
    $cnt 0;
            
    //The Loop
            
    if ( $count ) : foreach($items as $item) : 
                
    setup_postdata($item);
                
    $custom_values get_post_meta($item->ID'position'true);
                
            
    ?>
                <li>
                    <div class="entry-content">
                        <div class="entry-content-col1">
                            <div class="list-info">
                                 <?php echo get_the_post_thumbnail$item->ID'list-member-thumbnail' ); ?> 
                                <div class="list-info-text">
                                    <div class="name"><?php echo $item->post_title;?></div>
                                    <p class="title">
                                        <?php echo get_post_meta($item->ID'position'true);?>
                                    </p>
                                    <p>
                                        <?php echo get_post_meta($item->ID'head-text'true);?>
                                    </p>
                                </div>
                            </div>
                            <div class="list-detail" style="height:100%">
                            <?php the_content();?>
                            </div>    
                        </div>
                        <div class="entry-content-col2" style="display:none">
                            <div class="entry-content-arrow toggle-down"></div>
                        </div>
                    </div>
                </li>
            <?php
                $cnt
    ++;
            endforeach;
            endif;
        
    ?>
        </ul>
       <div class="clearfix"></div>
        
    </article><!-- #post-<?php the_ID(); ?> -->
    <?php wp_reset_postdata(); ?>
    "Who We Are" Page:

    PHP Code:
    <?php
    /**
     * The template used for displaying page content in page.php
     *
     * @package Scout
     * @since Scout 1.0
     */
    ?>
    <article id="post-<?php the_ID(); ?><?php post_class(); ?>>
        <header class="entry-header">
                <h1 class="entry-title"><?php the_title(); ?></h1>
        </header><!-- .entry-header -->
        <div class="entry-content">
            <?php the_content();?>
        </div>
        <ul id="list-members">
        <?php

            
    //The Query
            
    $items get_posts('cat=5&numberposts=100');
            
    $count count($items);
            
    $cnt 0;
            
    //The Loop
            
    if ( $count ) : foreach($items as $item) : 
                
    setup_postdata($item);
                
    $custom_values get_post_meta($item->ID'position'true);
                
            
    ?>
                <li>
                    <div class="entry-content">
                        <div class="entry-content-col1">
                            <div class="list-info">
                                 <?php echo get_the_post_thumbnail$item->ID'list-member-thumbnail' ); ?> 
                                <div class="list-info-text">
                                    <div class="name"><?php echo $item->post_title;?></div>
                                    <p class="title">
                                        <?php echo get_post_meta($item->ID'position'true);?>
                                    </p>
                                    <p>
                                        <?php echo get_post_meta($item->ID'head-text'true);?>
                                    </p>
                                </div>
                            </div>
                            <div class="list-detail">
                            <?php the_content();?>
                            </div>    
                        </div>
                        <div class="entry-content-col2">
                            <div class="entry-content-arrow toggle-down"></div>
                        </div>
                    </div>
                </li>
            <?php
                $cnt
    ++;
            endforeach;
            endif;
        
    ?>
        </ul>
        <div class="clearfix"></div>
        
    </article><!-- #post-<?php the_ID(); ?> -->
    <?php wp_reset_postdata(); ?>
    WordPress Post Code

    HTML Code:
    <div id="hover7" style="float: left;"><a href="http://youtu.be/3LbMZ3gJ6PQ" rel="prettyPhoto[pp_gal7]"><img style="margin: 10px;" src="http://neighboragency.com/wp-content/uploads/2013/02/HoverTrans.png" alt="" width="140" /></a></div>
    <div id="hover3" style="float: left;"><a href="http://neighboragency.com/wp-content/uploads/2013/02/Petco1.jpg" rel="prettyPhoto[pp_gal3]"><img style="margin: 10px;" src="http://neighboragency.com/wp-content/uploads/2013/02/HoverTrans.png" alt="" width="140" /></a></div>
    <div id="hover4" style="float: left;"><a href="http://neighboragency.com/wp-content/uploads/2013/02/OO1.jpg" rel="prettyPhoto[pp_gal4]"><img style="margin: 10px;" src="http://neighboragency.com/wp-content/uploads/2013/02/HoverTrans.png" alt="" width="140" /></a></div>
    <div id="hover12" style="float: left;"><a href="http://neighboragency.com/wp-content/uploads/2013/02/TMK_SF_FINAL_p1.jpg" rel="prettyPhoto[pp_gal12]"><img style="margin: 10px;" src="http://neighboragency.com/wp-content/uploads/2013/02/HoverTrans.png" alt="" width="140" /></a></div>
    <div id="hover6" style="float: left;"><a href="http://youtu.be/W_oLzOBgIRU" rel="prettyPhoto[pp_gal6]"><img style="margin: 10px;" src="http://neighboragency.com/wp-content/uploads/2013/02/HoverTrans.png" alt="" width="140" /></a></div>
    <div id="hover5" style="float: left;"><a href="http://neighboragency.com/wp-content/uploads/2013/02/Healdsburg1.jpg" rel="prettyPhoto[pp_gal5]"><img style="margin: 10px;" src="http://neighboragency.com/wp-content/uploads/2013/02/HoverTrans.png" alt="" width="140" /></a></div>
    <div id="hover11" style="float: left;"><a href="http://neighboragency.com/wp-content/uploads/2013/02/1_Community.jpg" rel="prettyPhoto[pp_gal11]"><img style="margin: 10px;" src="http://neighboragency.com/wp-content/uploads/2013/02/HoverTrans.png" alt="" width="140" /></a></div>
    <div id="hover8" style="float: left;"><a href="http://youtu.be/m4gJCavdE-Y" rel="prettyPhoto[pp_gal8]"><img style="margin: 10px;" src="http://neighboragency.com/wp-content/uploads/2013/02/HoverTrans.png" alt="" width="140" /></a></div>
    <div id="hover10" style="float: left;"><a href="http://www.youtube.com/watch?v=fNzJVHQB9DI&amp;list=PLB1A3DEEBD4B84E95" rel="prettyPhoto[pp_gal10]"><img style="margin: 10px;" src="http://neighboragency.com/wp-content/uploads/2013/02/HoverTrans.png" alt="" width="140" /></a></div>
    <div id="hover1" style="float: left;"><a href="http://neighboragency.com/wp-content/uploads/2013/02/SD1.jpg" rel="prettyPhoto[pp_gal1]"><img style="margin: 10px;" src="http://neighboragency.com/wp-content/uploads/2013/02/HoverTrans.png" alt="" width="140" /></a></div>
    <div id="hover2" style="float: left;"><a href="http://neighboragency.com/wp-content/uploads/2013/02/SVN_Bus.jpg" rel="prettyPhoto[pp_gal2]"><img style="margin: 10px;" src="http://neighboragency.com/wp-content/uploads/2013/02/HoverTrans.png" alt="" width="140" /></a></div>
    <div id="hover9" style="float: left;"><a href="http://neighboragency.com/wp-content/uploads/2013/02/KP1.png" rel="prettyPhoto[pp_gal9]"><img style="margin: 10px;" src="http://neighboragency.com/wp-content/uploads/2013/02/HoverTrans.png" alt="" width="140" /></a></div>
    Note:
    I had to create each of those "hover..." divs to make the gallery work. Here's what the CSS looks like for them all:

    Code CSS:
    #hover1 a:link{
        background-image:url([URL]http://neighboragency.com/wp-content/uploads/2013/03/SDThum.png);[/URL]
        width: 140px;
        height: 140px;
        display: block;
    margin-top: 5px;
    margin-right: 5px;
    margin-left: 5px;
    margin-bottom: 5px;
     
    }
     
    #hover1 a:hover{
        background-image:url([URL]http://neighboragency.com/wp-content/uploads/2013/03/SDThumHover.png);[/URL]
        width: 140px;
        height: 140px;
        display: block;
    margin-top: 5px;
    margin-right: 5px;
    margin-left: 5px;
    margin-bottom: 5px;
     
    }
    Attached Images Attached Images
    Last edited by SpacePhoenix; Mar 8, 2013 at 01:21. Reason: syntax highlighting tags around code blocks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •