Tagged: x
-
AuthorPosts
-
March 26, 2017 at 2:39 pm #1420824
1) I’ve looked around and couldn’t find a recent reply to this question. I’d like to format all page titles to look like the h-landmark titles in category or blog pages. How can I do that reliably, please.
http://ei.temp.lexi.net/2) Also can I change the timing for the fade-in on the home page to be snappier?
Please advise.March 26, 2017 at 10:52 pm #1421141Hello There,
Thanks for writing in! Do you want something like this?
If that is the case, please follow these steps:
#1] Since the child theme is set up, please add the following code in your child theme’s functions.php file// Modify the page titles // ============================================================================= function modify_page_titles($title){ if ( is_page() ) { return '<span>' . $title . '</span>'; } else { return $title; } } add_filter('the_title', 'modify_page_titles'); // =============================================================================
#2] And please add the following css code in the customizer, Appearance > Customize > Custom > Edit Global CSS
.page .entry-title { text-align: center; overflow: hidden; } .page .entry-title span { display: inline-block; position: relative; } .page .entry-title span:before, .page .entry-title span:after { content: ""; position: absolute; top: 50%; height: 1px; width: 275%; display: block; background-color: #e1e1e1; background-color: rgba(0,0,0,0.1); box-shadow: 0 1px 0 0 rgba(255,255,255,0.795); } .page .entry-title span:before { right: 100%; margin-right: 0.5em; } .page .entry-title span:after { left: 100%; margin-left: 0.5em; }
The fade in animation speed in your homepage can be change by editing the homepage back in Cornerstone and adjust the animation speed in each column settings.
Hope this helps.
March 27, 2017 at 3:48 pm #1422181Thank you. Yes, I wanted to see this solution as well, but for this site I wanted all page headers to look like:
http://ei.temp.lexi.net/news-views/ where the landmark title is above the page/sidebar. Is that possible? Post titles should not be affected.It would be good to have both options to compare. Thank you.
March 28, 2017 at 1:06 am #1422630Hi There,
So you want the pages to have a header landmark. Please navigate to your child theme’s x-child\framework\views\integrity. There create a file named _landmark-header.php and paste the code below on it:
<?php // ============================================================================= // VIEWS/INTEGRITY/_LANDMARK-HEADER.PHP // ----------------------------------------------------------------------------- // Handles content output of large headers for key pages such as the blog or // search results. // ============================================================================= $disable_page_title = get_post_meta( get_the_ID(), '_x_entry_disable_page_title', true ); $disable_filters = get_post_meta( get_the_ID(), '_x_portfolio_disable_filtering', true ); ?> <?php if ( is_home() && x_get_option( 'x_integrity_blog_header_enable' ) == '1' ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo x_get_option( 'x_integrity_blog_title' ); ?></span></h1> <p class="p-landmark-sub"><span><?php echo x_get_option( 'x_integrity_blog_subtitle' ); ?></span></p> </header> <!-- if page --> <?php elseif ( is_page() ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php the_title(); ?></span></h1> </header> <?php elseif ( is_search() ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1> <p class="p-landmark-sub"><span><?php _e( "Below you'll see everything we could locate for your search of ", '__x__' ); echo '<strong>“'; the_search_query(); echo '”</strong>'; ?></span></p> </header> <?php elseif ( is_category() || x_is_portfolio_category() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Category Archive', '__x__' ); $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all posts that have been categorized as ", '__x__' ) . '<strong>“' . single_cat_title( '', false ) . '”</strong>'; ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo $title ?></span></h1> <p class="p-landmark-sub"><span><?php echo $subtitle ?></span></p> </header> <?php elseif ( x_is_product_category() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Category Archive', '__x__' ); $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all items that have been categorized as ", '__x__' ) . '<strong>“' . single_cat_title( '', false ) . '”</strong>'; ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo $title ?></span></h1> <p class="p-landmark-sub"><span><?php echo $subtitle ?></span></p> </header> <?php elseif ( is_tag() || x_is_portfolio_tag() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Tag Archive', '__x__' ); $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all posts that have been tagged as ", '__x__' ) . '<strong>“' . single_tag_title( '', false ) . '”</strong>'; ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo $title; ?></span></h1> <p class="p-landmark-sub"><span><?php echo $subtitle; ?></span></p> </header> <?php elseif ( x_is_product_tag() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Tag Archive', '__x__' ); $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all items that have been tagged as ", '__x__' ) . '<strong>“' . single_tag_title( '', false ) . '”</strong>'; ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo $title; ?></span></h1> <p class="p-landmark-sub"><span><?php echo $subtitle; ?></span></p> </header> <?php elseif ( is_404() ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h1> <p class="p-landmark-sub"><span><?php _e( "You blew up the Internet. ", '__x__' ); ?></span></p> </header> <?php elseif ( is_year() ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h1> <p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'Y' ); echo '</strong>'; ?></span></p> </header> <?php elseif ( is_month() ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h1> <p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'F, Y' ); echo '</strong>'; ?></span></p> </header> <?php elseif ( is_day() ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h1> <p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'F j, Y' ); echo '</strong>'; ?></span></p> </header> <?php elseif ( x_is_portfolio() ) : ?> <?php if ( $disable_page_title != 'on' || $disable_filters != 'on' ) : ?> <header class="x-header-landmark x-container max width"> <?php if ( $disable_page_title != 'on' ) : ?> <h1 class="h-landmark"><span><?php the_title(); ?></span></h1> <?php endif; ?> <?php x_portfolio_filters(); ?> </header> <?php endif; ?> <?php elseif ( x_is_shop() && x_get_option( 'x_integrity_shop_header_enable' ) == '1' ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo x_get_option( 'x_integrity_shop_title' ); ?></span></h1> <p class="p-landmark-sub"><span><?php echo x_get_option( 'x_integrity_shop_subtitle' ); ?></span></p> </header> <?php elseif ( x_is_buddypress() ) : ?> <?php if ( x_buddypress_is_component_with_landmark_header() ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1> <p class="p-landmark-sub"><span><?php echo x_buddypress_get_the_subtitle(); ?></span></p> </header> <?php endif; ?> <?php endif; ?>
Then add this on the Custom > Global CSS to hide the default page title that was on the content.
.page .entry-header { display: none; }
Hope it helps, Cheers!
March 30, 2017 at 12:37 pm #1425521THANK YOU. This works just great. I’ll definitely keep referring to this thread for both methods of formatting the titles. One thing no longer works, is to selectively turn off page/post titles. I did that via custom css in Cornerstone for the home page, but don’t need the feature for subsequent pages. Am thrilled, I always wanted to know how to do that.
March 30, 2017 at 7:19 pm #1425746April 1, 2017 at 2:18 pm #1427022Darshana, the disable page titles in Cornerstone does not work for this. It has to be hidden with CSS. It’s a separate class, .h-landmark title. And the actual page titles are now hidden. See above code.
April 1, 2017 at 9:20 pm #1427177Hello There,
If you want to have the turn off page titles applied to the landmark title for pages, you will need to update the code of the landmarkheader file and use this:
<?php // ============================================================================= // VIEWS/INTEGRITY/_LANDMARK-HEADER.PHP // ----------------------------------------------------------------------------- // Handles content output of large headers for key pages such as the blog or // search results. // ============================================================================= $disable_page_title = get_post_meta( get_the_ID(), '_x_entry_disable_page_title', true ); $disable_filters = get_post_meta( get_the_ID(), '_x_portfolio_disable_filtering', true ); ?> <?php if ( is_home() && x_get_option( 'x_integrity_blog_header_enable' ) == '1' ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo x_get_option( 'x_integrity_blog_title' ); ?></span></h1> <p class="p-landmark-sub"><span><?php echo x_get_option( 'x_integrity_blog_subtitle' ); ?></span></p> </header> <!-- if page --> <?php elseif ( is_page() && $disable_page_title != 'on' ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php the_title(); ?></span></h1> </header> <?php elseif ( is_search() ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1> <p class="p-landmark-sub"><span><?php _e( "Below you'll see everything we could locate for your search of ", '__x__' ); echo '<strong>“'; the_search_query(); echo '”</strong>'; ?></span></p> </header> <?php elseif ( is_category() || x_is_portfolio_category() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Category Archive', '__x__' ); $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all posts that have been categorized as ", '__x__' ) . '<strong>“' . single_cat_title( '', false ) . '”</strong>'; ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo $title ?></span></h1> <p class="p-landmark-sub"><span><?php echo $subtitle ?></span></p> </header> <?php elseif ( x_is_product_category() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Category Archive', '__x__' ); $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all items that have been categorized as ", '__x__' ) . '<strong>“' . single_cat_title( '', false ) . '”</strong>'; ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo $title ?></span></h1> <p class="p-landmark-sub"><span><?php echo $subtitle ?></span></p> </header> <?php elseif ( is_tag() || x_is_portfolio_tag() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Tag Archive', '__x__' ); $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all posts that have been tagged as ", '__x__' ) . '<strong>“' . single_tag_title( '', false ) . '”</strong>'; ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo $title; ?></span></h1> <p class="p-landmark-sub"><span><?php echo $subtitle; ?></span></p> </header> <?php elseif ( x_is_product_tag() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Tag Archive', '__x__' ); $subtitle = ( $meta['archive-subtitle'] != '' ) ? $meta['archive-subtitle'] : __( "Below you'll find a list of all items that have been tagged as ", '__x__' ) . '<strong>“' . single_tag_title( '', false ) . '”</strong>'; ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo $title; ?></span></h1> <p class="p-landmark-sub"><span><?php echo $subtitle; ?></span></p> </header> <?php elseif ( is_404() ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h1> <p class="p-landmark-sub"><span><?php _e( "You blew up the Internet. ", '__x__' ); ?></span></p> </header> <?php elseif ( is_year() ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h1> <p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'Y' ); echo '</strong>'; ?></span></p> </header> <?php elseif ( is_month() ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h1> <p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'F, Y' ); echo '</strong>'; ?></span></p> </header> <?php elseif ( is_day() ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h1> <p class="p-landmark-sub"><span><?php _e( "Below you'll find a list of all posts from ", '__x__' ); echo '<strong>'; echo get_the_date( 'F j, Y' ); echo '</strong>'; ?></span></p> </header> <?php elseif ( x_is_portfolio() ) : ?> <?php if ( $disable_page_title != 'on' || $disable_filters != 'on' ) : ?> <header class="x-header-landmark x-container max width"> <?php if ( $disable_page_title != 'on' ) : ?> <h1 class="h-landmark"><span><?php the_title(); ?></span></h1> <?php endif; ?> <?php x_portfolio_filters(); ?> </header> <?php endif; ?> <?php elseif ( x_is_shop() && x_get_option( 'x_integrity_shop_header_enable' ) == '1' ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo x_get_option( 'x_integrity_shop_title' ); ?></span></h1> <p class="p-landmark-sub"><span><?php echo x_get_option( 'x_integrity_shop_subtitle' ); ?></span></p> </header> <?php elseif ( x_is_buddypress() ) : ?> <?php if ( x_buddypress_is_component_with_landmark_header() ) : ?> <header class="x-header-landmark x-container max width"> <h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1> <p class="p-landmark-sub"><span><?php echo x_buddypress_get_the_subtitle(); ?></span></p> </header> <?php endif; ?> <?php endif; ?>
What has change in the code above? I replace this line:
<!-- if page --> <?php elseif ( is_page() ) : ?>
Into this line:
<!-- if page --> <?php elseif ( is_page() && $disable_page_title != 'on' ) : ?>
Please let us know if this works out for you.
-
AuthorPosts