Custom Portfolio Item Layout?

I recently moved a customers site who was still running version 3.0 of the X theme. I upgraded to the newest version and it broke a bunch of the layouts that were on the old site. Can you tell me what file I need to edit in order to get the layout to look the same as it did before the theme upgrade? Thanks in advance!

Hi @partnersinfo,

Thanks for writing in.

I believe this is happening because it is not working because the CSS in the Style.css is not executed.

You could check the link below on how to setup child theme and to install your style.css.

Hope it helps.

Let us know how it goes.

Thanks.

@nico. Can you tell me which file in the main theme is where the php resides that controls the layout of this page? I can copy it and paste it into the child theme since we are already using it. I just cannot find the php file that is called when you look at the portfolio detail pages. I need to add in custom DIV’s to change the layout of the site, not just change the CSS. Thanks!

Hey Randy,

The template that runs Integrity single portfolio is content-portfolio.php located in \framework\views\integrity.

Your issue is not related to a template file though. I could say that because I switched to the parent theme in your site but the display is the same. The issue has to do with your CSS. See https://youtu.be/lMG9DOOasv0

I also saw you have 2 X versions in your Themes. I deleted the old version as that might cause problems.

Also note that the original Single Portfolio Layout is this. We have no support for customized templates so we could not help with geting the layout to look the same as it did before the theme upgrade.

Thank you for understanding.

Thanks Christian,
I will keep digging and see where the previous developer customized it if possible.

Can you help me with one last thing that doesn’t seem to be working with the theme? On 4 of the portfolio items, we put a Z in front of them to put them at the bottom since we are sorting based A-Z. However, the portfolio item settings “alternate index title” field is not working to correct this on the main page of the item.

Hey There,

I have checked your code and I have seen the Random Recent Post code. You are using this:

str_replace("Z","",get_the_title());

This code will remove any Z existing in the Post titles which is a bad idea because you can never use a word with a letter Z in it. If you want to order the output of the shortcode, you must use Order and OrderBy arguments instead. You should have ASC order for A-Z and title for the OrderBy argument. This query code might help to update your current code:

$q = new WP_Query( array(
      'order'            => 'ASC',
      'orderby'          => 'title',
      'post_type'        => "{$type}",
      'posts_per_page'   => "{$count}",
      'offset'           => "{$offset}",
      "{$category_type}" => "{$category}"
    ) );

Hope this helps. Kindly let us know.

Hello @RueNel, I need those 4 items to be the last items in the portfolio listing, hence the reason we put the Z in front of it to force them to be at the bottom. I added your code, and removed the Z’s from the portfolio items and now they are listed in the O section so they are not at the bottom of the list. Please advise how I can put these at the bottom of the list properly. Thank you!

Hi there,

The option on the page settings for the Alternate Index Title which is different from the page title. The index title will be the title that will be used for index pages such as the portfolio page and the post page.

You could use some Javascript instead to remove the z.

You can do this by assigning a common body class to those portfolio items where you added z on the first letter then add this code in the Global JS:

(function($){

    var val = $(".the-class .entry-title").html();
    $(".undo .entry-title").html(val.substring(1, val.length));

})(jQuery);

Please change the-class to the class value you added to the pages.

Hope this helps.

Thanks Jade, that helps for the portfolio listings page, but not for the portfolio detail page. Any way to add a body css class to the body element of that page easily?

Hi,

For the portfolio detail page, you can use the class .single-x-portfolio
It’s already added by the theme by default.

Thanks

I take that back @paul.r It looks like that worked, but it removed the first letter of every portfolio entry. Is there a way to make it just look for the portfolio items that start with a Z and remove just the Z?

Hi @partnersinfo

You can target these specific portfolio items with postid, please check this screenshot:




In this example, you can use .postid-692 as your class name. Do the same for the four portfolio posts with Z.

Thanks.

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