-
AuthorPosts
-
December 5, 2014 at 12:19 am #158776
DanielFennerParticipantJust a simple question.
I was wondering if it is possible to put some content above the Portfolio Masthead (Where it says “Sample page”) and below a slider? Can’t seem to figure out a way to do so.
Also, is there a way to remove the “Sort Content” Button completely and just list the categories, saving a click?
I’m using the integrity base theme, you can see where I’m up to here: http://danielfenner.com/
December 5, 2014 at 6:36 am #158884
DanielFennerParticipantOops I forgot to take the under construction page off! It’s off now so hopefully someone can help me figure it out, last thing I need to finish the website and start putting content on 🙂
December 5, 2014 at 1:31 pm #159055
RadModeratorHi there,
Thanks for posting in.
Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Add this code at your child theme’s functions.php
add_action('x_before_view_global__portfolio', 'the_content' );Then at your content at your page’s editor or by using visual composer.
Cheers!
December 5, 2014 at 5:25 pm #159197
DanielFennerParticipantThanks for the reply but adding that to the functions.php doesn’t do anything.
December 6, 2014 at 4:58 am #159396
ChristopherModeratorHi there,
Please create template-layout-portfolio.php file inside YOUR CHILD THEME -> framework -> views -> integrity and add this code in there:
<?php // ============================================================================= // VIEWS/INTEGRITY/TEMPLATE-LAYOUT-PORTFOLIO.PHP // ----------------------------------------------------------------------------- // Portfolio page output for Integrity. // ============================================================================= ?> <?php get_header(); ?> <div class="x-container-fluid max width offset cf"> <div class="<?php x_main_content_class(); ?>" role="main"> <?php echo do_shortcode ('[vc_row][vc_column][text_output]TestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTest[/text_output][/vc_column][/vc_row]'); ?> <?php x_get_view( 'global', '_portfolio' ); ?> </div> <?php get_sidebar(); ?> </div> <?php get_footer(); ?>Instead of
[vc_row][vc_column][text_output]TestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTest[/text_output][/vc_column][/vc_row]put your shortcode.Hope it helps.
May 23, 2015 at 9:00 am #280187
MengParticipantThank you so much! But is there no way to simply refer to the page content to be inserted, rather than to define static content to be rendered there? That would make editing and changing the information a lot easier down the road, rather than altering the view template every time…
Also, but using this method, the content is added below the “FILTER” button. I’d like to have my content above it, because it makes no sense to first see a filter button, then the introduction, and then the portfolio contents…
May 23, 2015 at 7:34 pm #280363
RadModeratorHi Meng,
Instead of doing that, you can follow another workaround here https://theme.co/x/member/forums/topic/adding-static-content-to-portfolio-pages/#post-206209
And instead of x_after_view_global__script-isotope-portfolio, it should be x_before_view_global__script-isotope-portfolio so your content will appear before the filter.
Then add your portfolio page content through the editor or by visual composer.
Thanks!
May 24, 2015 at 9:51 am #280706
MengParticipantHi there! Thanks for your advice. Unfortunately, following these instructions still results in the content displaying below the “FILTER” button.
I removed the customized views and added the following code into functions.php of my child theme:
add_action('x_before_view_global__script-isotope-portfolio', 'enable_content_p'); //portfolio function enable_content_p () { $page = get_page( get_the_ID()); echo '<div class="portfolio-page-content">'.apply_filters( 'the_content' , $page->post_content ).'</div>'; }May 24, 2015 at 5:41 pm #280870
RadModeratorHi,
In that case, let me check it too 🙂
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks!
May 24, 2015 at 7:34 pm #280918
MengParticipantThis reply has been marked as private.May 24, 2015 at 9:10 pm #280968
LelyModeratorHello Meng,
Before I can log in to wordpress admin it seems that authentication is required. Please do provide authentication Username and Password for that directory.
Thank you.
May 24, 2015 at 9:25 pm #280979
MengParticipantThis reply has been marked as private.May 24, 2015 at 10:33 pm #281014
Rue NelModeratorHello There,
Please discard all the suggested codes we gave in our previous replies. To be able to display a content above the filter button, you need to edit your landmark header file. To do this, please create a new file in your local computer. On the new file, please insert this code:
<?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' ) == '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> <?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_get_view( 'global', '_content', 'the-content' ); ?> <?php x_portfolio_filters(); ?> </header> <?php endif; ?> <?php elseif ( x_is_shop() && x_get_option( 'x_integrity_shop_header_enable', '1' ) == '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; ?>Save this file as
_landmark-header.phpand upload this file to your server in your child theme’s folderwp-content/themes/x-child/framework/views/integrity/Please let us know if this works out for you.
May 25, 2015 at 8:07 pm #281622
MengParticipantHey, thanks a lot! So it was the landmark header file after all, causing all that trouble. Do you think this file will change a lot over the coming updates? I hope I won’t have to keep manually adjusting it after future updates.
Replacing it with your suggested file did not mend the situation. As a matter of fact, the content did not display at all, anymore. But I’ve found a cure!
I replaced template-layout-portfolio.php with:
<?php // ============================================================================= // VIEWS/INTEGRITY/TEMPLATE-LAYOUT-PORTFOLIO.PHP // ----------------------------------------------------------------------------- // Portfolio page output for Integrity with content. // ============================================================================= ?> <?php get_header(); ?> <div class="x-container max width offset"> <div class="<?php x_main_content_class(); ?>" role="main"> <?php if ( $wp_query->have_posts() ) : ?> <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?> <?php x_get_view( 'global', '_content' ); ?> <?php endwhile; ?> <?php endif; ?> <?php x_portfolio_filters(); ?> <?php x_get_view( 'global', '_portfolio' ); ?> </div> <?php get_sidebar(); ?> </div> <?php get_footer(); ?>And I changed the following part of _landmark-header.php:
<?php elseif ( x_is_portfolio() ) : ?> <?php if ( $disable_page_title != 'on' || $disable_filters != 'on' ) : ?> <?php if ( $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 endif; ?> <?php endif; ?>May 25, 2015 at 10:02 pm #281700
DarshanaModeratorHi there,
Glad you were able to find a solution. We cannot guarantee whether a certain template file or a module will be changed frequently or not. Time to time when you’re doing updates, you can use a software like KDiff to analyze the changes between the current version and the updated version.
For detailed information, please go through the following post (https://community.theme.co//forums/topic/child-parent-theme-basics/#post-140278).
Thanks!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-158776 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
