Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #993752
    NailedIT
    Participant

    Hi,

    The page title for each Portfolio item is the same as the main Portfolio page. But I’d like the title of the portfolio item as page title.

    I found the following instructions which I wanted to try: https://community.theme.co/forums/topic/my-portfolio-sidebar-and-title/

    But the instructions are really outdated, the _landmark-header.php file looks totally different now.

    Could you give us an updated explanation on how to do that?

    Thanks a lot and best regards,
    Michael

    #993847
    Nabeel A
    Moderator

    Hi Michael,

    Thank you for writing in! If you check out http://theme.co/x/demo/integrity/1/portfolio-item/south-beach/ you’ll notice the page title is the same as Portfolio Item. Can you please clarify a bit with screenshots or perhaps share the URL of your page in question so we can take a closer look?

    Thanks!

    #995274
    NailedIT
    Participant

    Hi,

    Sure, with page title I meant the <h1> title in the header section of the page. In this example, instead of “Portfolio” I’d like the Portfolio Item title “Drum”: http://theme.co/x/demo/renew/1/portfolio-item/drum/

    Thanks and best regards,
    Michael

    #995348
    Christopher
    Moderator

    Hi there,

    Copy _landmark-header.php from framework/views/renew and put it in the same path inside child theme, replace existing code with following :

    <?php
    
    // =============================================================================
    // VIEWS/RENEW/_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 );
    $breadcrumbs        = x_get_option( 'x_breadcrumb_display' );
    
    ?>
    
    <?php if ( ! x_is_blank( 1 ) && ! x_is_blank( 2 ) && ! x_is_blank( 4 ) && ! x_is_blank( 5 ) ) : ?>
      <?php if ( is_page() && $disable_page_title == 'on' ) : ?>
    
      <?php else : ?>
    
        <header class="x-header-landmark">
          <div class="x-container max width">
            <div class="x-landmark-breadcrumbs-wrap">
              <div class="x-landmark">
    
              <?php if ( x_is_shop() || x_is_product() ) : ?>
    
                <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_shop_title' ); ?></span></h1>
    
              <?php elseif ( x_is_bbpress() ) : ?>
    
                <h1 class="h-landmark"><span><?php echo get_the_title(); ?></span></h1>
    
              <?php elseif ( x_is_buddypress() ) : ?>
                <?php if ( x_buddypress_is_component_with_landmark_header() ) : ?>
    
                  <h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1>
    
                <?php endif; ?>
              <?php elseif ( is_page() ) : ?>
    
                <h1 class="h-landmark entry-title"><span><?php the_title(); ?></span></h1>
    
              <?php elseif ( is_home() || is_single() ) : ?>
                <?php if ( x_is_portfolio_item() ) : ?>
    
                  <h1 class="h-landmark"><span><?php the_title(); ?></span></h1>
    
                <?php else : ?>
    
                  <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_blog_title' ); ?></span></h1>
    
                <?php endif; ?>
              <?php elseif ( is_search() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1>
    
              <?php elseif ( is_category() || x_is_portfolio_category() || x_is_product_category() ) : ?>
    
                <?php
    
                $meta  = x_get_taxonomy_meta();
                $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Category Archive', '__x__' );
    
                ?>
    
                <h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
    
              <?php elseif ( is_tag() || x_is_portfolio_tag() || x_is_product_tag() ) : ?>
    
                <?php
    
                $meta  = x_get_taxonomy_meta();
                $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Tag Archive', '__x__' );
    
                ?>
    
                <h1 class="h-landmark"><span><?php echo $title ?></span></h1>
    
              <?php elseif ( is_404() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h1>
    
              <?php elseif ( is_year() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h1>
    
              <?php elseif ( is_month() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h1>
    
              <?php elseif ( is_day() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h1>
    
              <?php elseif ( x_is_portfolio() ) : ?>
    
                <h1 class="h-landmark"><span><?php the_title(); ?></span></h1>
    
              <?php endif; ?>
    
              </div>
    
              <?php if ( $breadcrumbs == '1' ) : ?>
                <?php if ( ! is_front_page() && ! x_is_portfolio() ) : ?>
                  <div class="x-breadcrumbs-wrap">
                    <?php x_breadcrumbs(); ?>
                  </div>
                <?php endif; ?>
              <?php endif; ?>
    
              <?php if ( x_is_portfolio() ) : ?>
                <div class="x-breadcrumbs-wrap">
                  <?php x_portfolio_filters(); ?>
                </div>
              <?php endif; ?>
    
            </div>
          </div>
        </header>
    
      <?php endif; ?>
    <?php endif; ?>

    Copy content-portfoli.php from framework/views/renew and put it in the same path inside child theme, replace existing code with following :

    <?php
    
    // =============================================================================
    // VIEWS/RENEW/CONTENT-PORTFOLIO.PHP
    // -----------------------------------------------------------------------------
    // Portfolio post output for Renew.
    // =============================================================================
    
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
      <?php if ( ! x_is_portfolio_item() ) : ?>
    
        <div class="entry-featured">
          <?php x_portfolio_item_featured_content(); ?>
          <div class="entry-cover">
            <div class="entry-cover-content">
              <span><?php echo get_post_meta( get_the_ID(), '_x_portfolio_media', true ); ?></span>
              <h2 class="entry-title entry-title-portfolio">
                <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php x_the_alternate_title(); ?></a>
              </h2>
              <span><?php echo get_the_date( 'm.d.y' ); ?></span>
            </div>
          </div>
        </div>
    
      <?php endif; ?>
    
      <div class="entry-wrap cf">
    
        <?php if ( is_singular() ) : ?>
    
          <div class="entry-info">
            <div class="entry-featured">
              <?php x_featured_portfolio( 'cropped' ); ?>
            </div>
            <header class="entry-header">
              <?php x_renew_entry_meta(); ?>
            </header>
            <?php x_get_view( 'global', '_content', 'the-content' ); ?>
          </div>
          <div class="entry-extra">
            <?php x_portfolio_item_tags(); ?>
            <?php x_portfolio_item_project_link(); ?>
            <?php x_portfolio_item_social(); ?>
          </div>
    
        <?php endif; ?>
    
      </div>
    </article>

    Hope it helps.

    #996957
    NailedIT
    Participant

    Hi there,

    Thanks for your answer, that helped. If someone is looking for the same solution, here some clarifications:

    The change in the “content-portfolio.php” is not necessary, if you don’t want to remove the second Portfolio Item title (in the content/beneath the image).

    In the “_landmark-header.php” you have to replace the following code:

    <?php if ( x_is_portfolio_item() ) : ?>
    
         <h1 class="h-landmark"><span><?php echo x_get_parent_portfolio_title(); ?></span></h1>
    
    <?php else : ?>

    With this code:

    <?php if ( x_is_portfolio_item() ) : ?>
    
         <h1 class="h-landmark"><span><?php echo the_title(); ?></span></h1>
    
    <?php else : ?>

    In plain words: Now it shows “the_title” instead of the “x_get_parent_portfolio_title”.

    Maybe that helps someone else 🙂

    Thanks and best regards,
    Michael

    #996966
    Christopher
    Moderator

    You’re welcome Michael.

  • <script> jQuery(function($){ $("#no-reply-993752 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>