Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter Stacienk

    (@stacienk)

    I apologize, I wasn’t present for the website update – I know it’s based on twenty twelve with some minor customizations. I will give it a try. I appreciate you trying to help me very much.

    Stacie

    Thread Starter Stacienk

    (@stacienk)

    We add projects through our dashboard (like you would add a post category) then using advanced custom fields we assign a featured image (it’s this featured image that is displayed as a thumbnail on Projects). If you click on a thumbnail, a larger image of that project appears aside 3-5 thumbnails. the 3-5 thumbnails display, but when clicked the large image is not opened.

    Thread Starter Stacienk

    (@stacienk)

    With this theme enabled the project photos are not visible, they are pulled into the project page template. Let me change it back so you can see.

    Thread Starter Stacienk

    (@stacienk)

    Ok, ready

    Thread Starter Stacienk

    (@stacienk)

    I just did a debug and got this error:

    Notice: Undefined index: id in /usr/home/gandrc/www/htdocs/wp-content/themes/gr_elevators/page-projects.php on line 13

    Here’s the code from page-projects.php – can you tell me if something looks off/wrong/bad?

    <?php
    //Template Name: Projects
    get_header(); ?>
    
    	<div class="wrapper projects">
    		<div id="content" role="main">
    
    			<div class="showcase banner">
    
    				<?php
    
    				//Get the ID from the query string
    				$project_id = $_GET['id'];
    
    				//If there isn't an id passed then default to the 'main project'
    				if( !isset($project_id) ) {
    					query_posts( array(
    	                'post_type' => 'our-projects',
    	                'posts_per_page' => 1,
    	                'cat' => 5
    	                ) );
    				} else {
    					query_posts( array(
    	                'post_type' => 'our-projects',
    	                'posts_per_page' => 1,
    	                'p' => $project_id
    	                ) );
    				}
    
    	            if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    	            <?php
    		            $loc_name = wp_get_post_terms($post->ID, 'location', array("fields" => "names"));
    					$count = count($loc_name);
    					$location = '';
    					 if ( $count > 0 ){
    					     foreach ( $loc_name as $term ) {
    					       $location .= ' ' . $term;
    					     }
    					 }
    	            ?>
    
    	            	<div class="gallery" id="<?php echo get_the_ID(); ?>">
    	            		<div class="main-image">
    	            			<div class="loader"><i class="fa-spin"></i></div>
    							<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail( array(405,500) ); } ?>
    							<div class="thumb"><?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail('thumbnail'); } ?></div>
    						</div>
    					</div>
    
    					<div class="info">
    						<h1><?php the_title(); ?></h1>
    						<p class="byline"><?php echo $location; ?></p>
    						<div class="desc">
    							<?php the_content(); ?>
    						</div>
    
    						<div class="thumbs">
    							<?php
    
    							for ($i=0; $i < 20; $i++) {
    								$field_name = 'project_image_' . $i;
    								$attachment_id = get_post_meta( get_the_ID(), $field_name, true );
    								$full_size = wp_get_attachment_image_src( $attachment_id, "full" );
    
    								//HTML
    								if ($attachment_id) echo '<a href="'. $full_size[0] .'">'; // url = $image[0]; width = $image[1]; height = $image[2];
    								echo wp_get_attachment_image( $attachment_id, 'thumbnail' );
    								if ($attachment_id) echo '</a>';
    							}
    
    							?>
    						</div>
    					</div>
    
    	                <?php endwhile; ?>
    	            <?php endif; ?>
    	            <?php wp_reset_query(); ?>
    
    			</div>
    
    			</div><!-- end #content -->
    
    			<div class="project-title">
    				<h2>Project Gallery</h2>
    
    				<?php
    
    					//Create Materials select
    					$mats = get_terms('materials');
    
    					$count = count($mats);
    					if ( $count > 0 ){
    						echo '<select name="materials" id="select-materials">';
    						echo '<option value="all" class="selected">Show All Materials</option>';
    						foreach ( $mats as $term ) {
    							echo '<option value="'.$term->slug.'">'.$term->name.'</option>';
    						}
    						echo '</select>';
    					}
    
    					//Create Location select
    					$locs = get_terms('location');
    
    					$count = count($locs);
    					if ( $count > 0 ){
    						echo '<select name="location" id="select-location">';
    						echo '<option value="all" class="selected">Show All Locations</option>';
    						foreach ( $locs as $term ) {
    							echo '<option value="'.$term->slug.'">'.$term->name.'</option>';
    						}
    						echo '</select>';
    					}
    
    				?>
    			</div><!-- /.project-title -->
    
    			<div id="filter" class="cols">
    
    				<?php
    				query_posts( array(
    	                'post_type' => 'our-projects',
    	                'posts_per_page' => -1,
    	                'order' => 'ASC') );
    
    	            if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    	            <?php
    
    	            $mats = wp_get_post_terms($post->ID, 'materials', array("fields" => "slugs"));
    				$count = count($mats);
    				$tax_class = '';
    				 if ( $count > 0 ){
    				     foreach ( $mats as $term ) {
    				       $tax_class .= ' ' . $term;
    				     }
    				 }
    
    				$locs = wp_get_post_terms($post->ID, 'location', array("fields" => "slugs"));
    				$count = count($locs);
    				 if ( $count > 0 ){
    				     foreach ( $locs as $term ) {
    				       $tax_class .= ' ' . $term;
    				     }
    				 }
    
    				$loc_name = wp_get_post_terms($post->ID, 'location', array("fields" => "names"));
    				$count = count($loc_name);
    				$location = '';
    				 if ( $count > 0 ){
    				     foreach ( $loc_name as $term ) {
    				       $location .= ' ' . $term;
    				     }
    				 }
    			 	?>
    
    	            <div class="project <?php if ($project_id == get_the_ID()) echo 'selected'; ?> id-<?php echo get_the_ID(); ?> <?php echo $tax_class ?>">
    	            	<a href="<?php the_permalink(); ?>" class="project-thumb" title="<?php the_title(); ?>">
    						<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail('medium'); } ?>
    					</a>
    					<a class="project-info" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
    						<h4><?php the_title(); ?></h4>
    						<p class="byline"><?php echo $location; ?></p>
    					</a>
    
    					<!-- showcase -->
    					<div class="showcase-content">
    
    						<div class="gallery">
    		            		<div class="main-image">
    		            			<div class="loader"><i class="fa-spin"></i></div>
    								<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail( array(405,500) ); } ?>
    								<div class="thumb"><?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail('thumbnail'); } ?></div>
    							</div>
    						</div>
    
    						<div class="info">
    							<h1><?php the_title(); ?></h1>
    							<p class="byline"><?php echo $location; ?></p>
    							<div class="desc">
    								<?php the_content(); ?>
    							</div>
    
    							<div class="thumbs">
    								<?php
    
    								for ($i=0; $i < 20; $i++) {
    									$field_name = 'project_image_' . $i;
    									$attachment_id = get_post_meta( get_the_ID(), $field_name, true );
    									$full_size = wp_get_attachment_image_src( $attachment_id, "full" );
    
    									//HTML
    									if ($attachment_id) echo '<a href="'. $full_size[0] .'">'; // url = $image[0]; width = $image[1]; height = $image[2];
    									echo wp_get_attachment_image( $attachment_id, 'thumbnail' );
    									if ($attachment_id) echo '</a>';
    								}
    
    								?>
    							</div>
    						</div>
    
    					</div>
    					<!-- showcase -->
    
    				</div>
    
    	                <?php endwhile; ?>
    	            <?php endif; ?>
    	            <?php wp_reset_query(); ?>
    
    			</div> <!-- end .thumbs -->
    
    	</div><!-- end .wrapper -->
    
    <?php get_footer(); ?>
    Thread Starter Stacienk

    (@stacienk)

    Thank you, I will give it a try

    Thread Starter Stacienk

    (@stacienk)

    Hi,
    Yes I did both and nothing changed.

    Thread Starter Stacienk

    (@stacienk)

    Thanks Digico,

    I’ll take a look at it. Happy New Year!

    Stacie

    Thread Starter Stacienk

    (@stacienk)

    Hi NeoTechnomad,

    Thanks for your response. When I choose Appearance –> Widgets–> It appears to me that I have added the sign up form and recent posts to what is titled the Main Sidebar. Is there a secret location for me to pick up Sidebar-1 other than what I see by working through the admin dashboard?

    I have Privacy Policy, Request A Quote, Download Brochure displayed in the bottom menu footer (there are actually 4 menu’s, we are using 3).

    When I Inspect Element I can see that #secondary is not included within the content area – here’s my blog page template code:

    `<?php
    //Template Name: Blog
    get_header(); ?>

    <div class=”wrapper blog”>
    <div id=”content” role=”main”>

    <?php
    query_posts( array(
    ‘posts_per_page’ => -1));

    if (have_posts()) : while (have_posts()) : the_post(); ?>

    <?php get_template_part( ‘content’, get_post_format() ); ?>

    <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>

    </div><!– end #content –>

    <?php get_sidebar(); ?>

    </div><!– end .wrapper –>

    <?php get_footer(); ?>

    Is there css that will hid the sidebar on the blog page, but display it on single posts?

    Thanks kindly,
    Stacie

    Thread Starter Stacienk

    (@stacienk)

    Thanks James, I appreciate your response, I’ll check it out.
    Stacie

    Thread Starter Stacienk

    (@stacienk)

    thank you, I appreciate it.

    I’ve been searching for other menu item styles and can’t seem to locate any, could you suggest where I could safely put this (even if the other 2 menu items aren’t styled this way)?

Viewing 11 replies - 1 through 11 (of 11 total)