Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #160624

    Ohia.Wins
    Participant

    Hello,

    Which document to I modify to change the Portfolio landing page template?

    I would like to be able to have content above the portfolio feed.

    ~ohia
    http://tineopatagonia.com/activities/

    #160890

    Christian
    Moderator

    Hey there,

    We recommend that you setup a child theme first. See http://theme.co/x/member/kb/how-to-setup-child-themes/ for instructions. After that, copy template-layout-portfolio.php located in wp-content\themes\x\framework\views\(YOUR STACK) to the same folder in your child theme wp-content\themes\x\framework\views\(YOUR STACK). Open the copied file and put your content right above the line

    <?php x_get_view( 'global', '_portfolio' ); ?>

    Hope that helps. 🙂

    #165149

    Ohia.Wins
    Participant

    on it.

    MUCHAS GRACIAS!!! hope this is helpful for others and not redundant.

    #165150

    Ohia.Wins
    Participant

    does the integrity light child theme count? is that going to be overwritten on update?

    #165151

    Ohia.Wins
    Participant

    one more thing. is there anyway to modify the page so that i can add content in the backend of the site? with the visual composer even? My client wont be able to modify the content if we have to go through the file structure each time.

    #165315

    Paul R
    Moderator

    Hi,

    No, the child theme won’t get overwritten on theme update.

    With regards to portfolio page.

    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.

    Then create file _portfolio.php in wp-content\themes\{X-CHILD-DIRECTORY}\framework\views\global
    and copy the code below into that file.

    
    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_PORTFOLIO.PHP
    // -----------------------------------------------------------------------------
    // Includes the portfolio output.
    // =============================================================================
    
    $stack    = x_get_stack();
    $entry_id = get_the_ID();
    $paged    = ( is_front_page() ) ? get_query_var( 'page' ) : ( ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1 );
    $cols     = get_post_meta( $entry_id, '_x_portfolio_columns', true );
    $count    = get_post_meta( $entry_id, '_x_portfolio_posts_per_page', true );
    $filters  = get_post_meta( $entry_id, '_x_portfolio_category_filters', true );
    
    switch ( $cols ) {
      case 'One'   : $cols = 1; break;
      case 'Two'   : $cols = 2; break;
      case 'Three' : $cols = 3; break;
      case 'Four'  : $cols = 4; break;
    }
    
    ?>
    
    <?php x_get_view( 'global', '_script', 'isotope-portfolio' ); ?>
    
    <div id="x-iso-container" class="x-iso-container x-iso-container-portfolio cols-<?php echo $cols; ?>">
    <?php
    $page_object = get_page( get_queried_object_id());
    echo '<div class="portfolio-page-content">'.do_shortcode($page_object->post_content).'</div>';
    ?>
      <?php
    
      if ( count( $filters ) == 1 && in_array( 'All Categories', $filters ) ) {
    
        $args = array(
          'post_type'      => 'x-portfolio',
          'posts_per_page' => $count,
          'paged'          => $paged
        );
    
      } else {
    
        $args = array(
          'post_type'      => 'x-portfolio',
          'posts_per_page' => $count,
          'paged'          => $paged,
          'tax_query'      => array(
            array(
              'taxonomy' => 'portfolio-category',
              'field'    => 'id',
              'terms'    => $filters
            )
          )
        );
    
      }
    
      $wp_query = new WP_Query( $args );
    
      ?>
    
      <?php if ( $wp_query->have_posts() ) : ?>
        <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
          <?php if ( $stack != 'ethos' ) : ?>
            <?php x_get_view( $stack, 'content', 'portfolio' ); ?>
          <?php else : ?>
            <?php x_ethos_entry_cover( 'main-content' ); ?>
          <?php endif; ?>
        <?php endwhile; ?>
      <?php endif; ?>
    
    </div>
    
    <?php pagenavi(); ?>
    <?php wp_reset_query(); ?>
    

    You can then add a content to your page in the backend of the site and will display in your portfolio page.

    Hope this helps.

    #166633

    Ohia.Wins
    Participant

    Hey buddies,

    I did just as you said and the ol portfolio landing page is looking kind of funky now.

    portfolio landing page fun

    i deleted the template-layout-portfolio.php from the first reply solution you gave me but it was still looking cray cray so i added it back in for launch tomorrow and removed the second document with code above. wondering if there is a real solution for this specific modification.

    thanks for all of your awesome effort. im telling everyone i know to buy X

    #166924

    Zeshan
    Member

    Hi Ohia,

    Thanks for writing in!

    Upon checking, it seems you’re website is in coming soon mode. Would you mind providing us with WordPress login credentials so we can take a closer look? To do this, you can make a post with the following info:

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks!

    #167166

    Ohia.Wins
    Participant
    This reply has been marked as private.
    #167582

    Zeshan
    Member

    Hi Ohia,

    Thanks for the logins!

    Were you able to resolve this issue? As upon checking, the page looks fine to me (see: http://prntscr.com/5ijebk) and the content is correctly appearing from the backend page. Would you mind confirming?

    Page: http://tineopatagonia.com/futaleufu-activities/

    Thanks!

    #169090

    Ohia.Wins
    Participant

    Oh snap. No actually I did not figure it out. It appears that the content is working correctly in the backend BUT the content that was there in the VC was just being saved for when it did work properly. I deleted the backend content and you can see on the front end that the hardcoded content is still on the frontend. I put it in the actual template.

    Does it behoove us to have content on the blog feed page? I really dont see this very often in the world of web and I don’t really understand why our site should be different than anyone elses. My boss is learning A LOT about SEO (and can get overexcited about it, like all good geeks should) and swears that we need content on this page but I feel like X theme wouldn’t purposefully provide users with a page that gets bad reviews for SEO. Is there any advice you can give about why the portfolio and blog landing pages do not readily include areas for content? Seems like if it was needed you smarty pantses would make it so.

    In the mean time I’d like to deliver to the client/my boss so is there a way to make the portfolio and blog feed landing pages capable of having backend content creation and modification?

    MUCHAS GRACIAS y FELIZ NAVIDAD,

    Ohia

    #169518

    Christian
    Moderator

    Hey Ohia,

    That may be because of caching. The cached page is being served. Please clear all the caches and also your browser history. Let us know how it goes.

    Thanks.

    #170222

    Ohia.Wins
    Participant

    i cleared all browsing history and the customized template-layout-portfolio.php solution suggested in your first reply is what is being served.

    It appeared for you that the content was working correctly in the backend BUT the content that was there in the VC was just being saved for when it did work properly. I deleted the backend content and you can see on the frontend that the hardcoded content is still on the frontend. I put it in the actual template.

    Does it behoove us to have content on the blog feed page? I really dont see this very often in the world of web and I don’t really understand why our site should be different than anyone elses. My boss is learning A LOT about SEO (and can get overexcited about it, like all good geeks should) and swears that we need content on this page but I feel like X theme wouldn’t purposefully provide users with a page that gets bad reviews for SEO. Is there any advice you can give about why the portfolio and blog landing pages do not readily include areas for content? Seems like if it was needed you smarty pantses would make it so.

    In the mean time I’d like to deliver to the client/my boss so is there a way to make the portfolio and blog feed landing pages capable of having backend content creation and modification?

    thanks again
    ohia

    #170223

    Ohia.Wins
    Participant

    the question that is most important is, can the backend portfolio and blog feed landing pages be made capable of having content served via visual composer at the top?

    #170519

    Paul R
    Moderator

    Hi,

    By default, portfolio layout and blog layout are not designed to display it’s content
    but it can be done through code customization as the one given above.

    I have tested the code given here https://theme.co/x/member/forums/topic/portfolio-landing-page-modification/#post-165315
    and the code actually works.

    Would you mind providing us your ftp login details so we can take a closer look.

    Thanks