Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Override sitewide default layout for Blog posts only? #64267
    heather
    Participant

    Perfect, thanks.

    Actually I went the route I did because at least for launch there will be many more site pages needing fullwidth than blog posts 🙂 I am dearly hoping they can scrape up 6 posts for launch, but moving forward they will benefit from not having to set sidebar manually. Eventually 🙂

    Thanks again.

    in reply to: Place page title over featured image #61057
    heather
    Participant

    Hi,
    I am finding that this only works if I designate a specific image and when the theme uses the default no H1 is output. Approximately 70% of the site pages use a unique header image but the rest rely on the fallback so sorting this out would be a big help. I suspect I either need to move where I have the H1 call or add it somewhere else where the default is output. Also I want to add a couple more bits to this area so getting my head around where things over the image should be in the functions is key.

    Settings:
    Customize> Header Image: Entire Site, Page/Post Featured Image
    Featured Header Image Position: After Secondary Menu (I’m not using one)

    My Functions code in child theme:

    if ( ! function_exists( 'fullframe_archive_content_image' ) ) :
    	/**
    	 * Template for Featured Image in Archive Content
    	 *
    	 * To override this in a child theme
    	 * simply create your own fullframe_archive_content_image(), and that function will be used instead.
    	 *
    	 * @since Full Frame 1.0
    	 */
    	function fullframe_archive_content_image() {
    		$options 			= fullframe_get_theme_options();
    		
    		$featured_image = $options['content_layout'];
    			
    		if ( has_post_thumbnail() && 'full-content' != $featured_image ) { ?>
     
    <header class="entry-header">
    	<h1 class="entry-title">
    		<a>" rel="bookmark">
    <?php the_title(); ?>
    		</a>
    	</h1>
    </header>
    <!-- .entry-header -->		
    			<figure class="featured-image">
    	            <a rel="bookmark">">
    	                <?php 
    						if ( $featured_image == 'excerpt-image-left' || $featured_image == 'excerpt-image-right' ) {
    		                     the_post_thumbnail( 'fullframe-featured-content' );
    		                }
    		                elseif ( $featured_image == 'excerpt-image-top' ) {
    		                     the_post_thumbnail( 'fullframe-featured' );
    		                }
    		               	elseif ( $featured_image == 'excerpt-full-image' ) {
    		                     the_post_thumbnail( 'full' );
    		                }		                
    					?>
    				</a>
    				
    	        </figure>
    
    	   	<?php
    		}
    	}
    endif; //fullframe_archive_content_image
    add_action( 'fullframe_before_entry_container', 'fullframe_archive_content_image', 10 );
    
    if ( ! function_exists( 'fullframe_featured_page_post_image' ) ) :
    	/**
    	 * Template for Featured Header Image from Post and Page
    	 *
    	 * To override this in a child theme
    	 * simply create your own fullframe_featured_imaage_pagepost(), and that function will be used instead.
    	 *
    	 * @since Full Frame 1.0
    	 */
    	function fullframe_featured_page_post_image() {
    		global $post, $wp_query;
    
    		// Get Page ID outside Loop
    		$page_id = $wp_query->get_queried_object_id();
    		$page_for_posts = get_option('page_for_posts');
    
    		if ( is_home() && $page_for_posts == $page_id ) {
    			$header_page_id = $page_id;
    		}
    		else {
    			$header_page_id = $post->ID;
    		}
    
    		if( has_post_thumbnail( $header_page_id ) ) {
    		   	$options					= fullframe_get_theme_options();	
    			$featured_header_image_url	= $options['featured_header_image_url'];
    			$featured_header_image_base	= $options['featured_header_image_base'];
    
    			if ( '' != $featured_header_image_url ) {
    				//support for qtranslate custom link
    				if ( function_exists( 'qtrans_convertURL' ) ) {
    					$link = qtrans_convertURL( $featured_header_image_url );
    				}
    				else {
    					$link = esc_url( $featured_header_image_url );
    				}
    				//Checking Link Target
    				if ( '1' == $featured_header_image_base ) {
    					$target = '_blank';
    				}
    				else {
    					$target = '_self'; 	
    				}
    			}
    			else {
    				$link = '';
    				$target = '';
    			}
    			
    			$featured_header_image_alt	= $options['featured_header_image_alt'];
    			// Header Image Title/Alt
    			if ( '' != $featured_header_image_alt ) {
    				$title = esc_attr( $featured_header_image_alt ); 	
    			}
    			else {
    				$title = '';
    			}
    			
    			$featured_image_size	= $options['featured_image_size'];
    		
    			if ( 'slider' ==  $featured_image_size ) {
    				$feat_image = get_the_post_thumbnail( $post->ID, 'fullframe-slider', array('id' => 'main-feat-img'));
    			}
    			else if ( 'full' ==  $featured_image_size ) {
    				$feat_image = get_the_post_thumbnail( $post->ID, 'full', array('id' => 'main-feat-img'));
    			}
    			else {
    				$feat_image = get_the_post_thumbnail( $post->ID, 'fullframe-large', array('id' => 'main-feat-img'));
    			}
    			
    			$fullframe_featured_image = '<div id="header-featured-image" class =' . $featured_image_size . '>';
    				// Header Image Link 
    				if ( '' != $featured_header_image_url ) :
    					$fullframe_featured_image .= '<a title="'. esc_attr( $title ).'" href="'. esc_url( $link ) .'" target="'.$target.'">' . $feat_image . '</a>'; 	
    				else:
    					// if empty featured_header_image on theme options, display default
    					$fullframe_featured_image .= $feat_image;
    				endif;
    			$fullframe_featured_image .= '<header class="entry-header"><h1 class="entry-title">' . get_the_title(). '</h1></header></div><!-- #header-featured-image -->';
    			
    			echo $fullframe_featured_image;
    		}
    		else {
    			fullframe_featured_image();
    		}		
    	} // fullframe_featured_page_post_image
    endif;
    add_action( 'fullframe_before', 'fullframe_featured_image_display' );

    Thanks again for getting me this far, hoping you can help me finish this too.

    in reply to: Place page title over featured image #60537
    heather
    Participant

    Yep. That did the trick perfectly – thanks!

    in reply to: Place page title over featured image #60516
    heather
    Participant

    Thanks much.
    I have don’t quite have it working though. Wouldn’t I also need to include the area that directs the output for the <div id=”header-featured-image”> ? so that I can place my title within it? Also I found that I needed to edit not just content.php but also content-page.php and content-single.php to remove the title from the content area across the site.

    Am I missing something about the archive image function? When I include my title code there nothing is output to the html. I did find the call for the div in fullframe-custom-header.php and tried moving those functions into my child theme functions.php but I am still not able to render the title tag.

    Any further advice?

    Thanks
    hgm

Viewing 4 posts - 1 through 4 (of 4 total)