Replace the header in the portfolio listing page and all portfolio detail pages using X Theme

Hi , I am using X theme with the Ethos stack and would like to replace the header for the portfolio listing page and all portfolio detail pages. I am using a child theme and saw in older posts that the _landmark-header.php could be added to the child theme and edited to accomplish this. I don’t see the _landmark-header.php in the views/ethos folder of the main X theme’s files. Please let me know how I can accomplish this with the current version of X theme.
Thanks!
Rich

Hi Rich,

The feature you want is the customization which is outside of our support scope. We will be able to give you the file path that you can use to override on your Child Theme but the customization itself will be on your shoulders.

The file in question is in:

wp-content/themes/pro/framework/legacy/cranium/headers/views/ethos/_landmark-header.php

Alternatively, you can convert your X installation to Pro where you are able to add as many as headers that you like with the Header Builder and assign them to the place you want. For more information:

Thank you.

Hi Christopher, about the Pro theme would I be able to assign one custom header to the Blog listing page and Blog post pages and a different custom header to the portfolio listing page and all portfolio post pages?

Regarding X theme options, I’ll look into the landmark-header.php file.

I noticed that I’m able to assign a custom header to my blog pages by using the following code in my child theme’s functions.php file:

function custom_banner() { 
 if ( is_home () ) : ?>
<div id="st-headline-image-area" class="x-section dark-section bg-image" style="margin: 0px;padding: 0px;" data-x-element="section" data-x-params="{&quot;type&quot;:&quot;image&quot;,&quot;parallax&quot;:false}">
<div class="x-container st-headline-area" style="margin: 0px auto; background-color:hsla(0, 0%, 0%, 0);">
<div class="x-column x-sm x-1-1" style="padding: 0px;">
<h1 class="h-custom-headline man h2"><span></span></h1>
<div class="x-raw-content sub-headline" style="right-margin: 5.25em auto 5.25em;max-width: 24em;"> Subscribe to our <a href='?feed=rss2'>RSS feed</a> to keep up with the latest articles.</div>
</div>
</div>
</div>
  <?php endif; 
}
add_action('x_after_view_header_base','custom_banner', 30);

Can I leverage this approach to also add a custom header to my portfolio listing and post pages? If so, please let me know what function I would use instead of is_home() to match the portfolio listing and post pages.

Thanks,
Rich

Hi Christopher,

I was able to get this working using the _landmark-header.php file as you mentioned. I copied this file from my main x theme to my child theme at the same path. Then I replaced the content for the following sections with the custom header content I wanted:

<?php elseif ( x_is_portfolio_item() ) : ?>

<?php elseif ( is_category() || x_is_portfolio_category() || x_is_product_category() || x_is_portfolio()) : ?>

I also had to move the elseif ( is_page() ) block below the portfolio elseif blocks so that they could be evaluated before the is_page block.

It’s now working. Thanks!

Hi Rich,

Glad you figured things out,

Regarding your question about PRO theme

The answer is yes, you can create a header for each of those and assign accordingly.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.