-
AuthorPosts
-
April 25, 2014 at 5:46 am #37100
Hello,
How did I change the portfolio item (.php) with CSS to act like a page ?
Second: Iin the the portfolio item background is set to grey, I cant change that.Please help.
thanksScreenshots
http://www.evernote.com/shard/s1/sh/2af4ed9e-75a1-45a5-b6dc-5ae8bfca3439/3e75917fec6bf5c6e7bfa6c07b22c0b6April 25, 2014 at 3:34 pm #37259Hi Chris,
I’m sorry, the portfolio items can’t be given page templates and made full width. You can however, create separate pages for each item.
In your portfolio items, you can set a “Project Link” and place a link to the page you created. This is usually meant for linking to an external source
Next, add this to the functions.php of your child theme.
This code will make that portfolio item directly link to the “Project Link” instead of the portfolio item page.
add_filter( 'post_type_link', 'x_remap_portfolio_permalink_to_project_link', 10, 4); function x_remap_portfolio_permalink_to_project_link($post_link, $post, $leavename, $sample) { if ('x-portfolio' == $post->post_type) { $custom = get_post_custom($post->id); if (isset($custom['_x_portfolio_project_link']) && $custom['_x_portfolio_project_link'][0]!='') return $custom['_x_portfolio_project_link'][0]; } return $post_link; }
EDIT: I’d like to add a bit more info here, as this workaround has been referred to in other topics.
The code above will change the link of the portfolio items. So when you click an item from the portfolio page, it will send you directly to the custom link. This helps if you want a more unique layout that can only be created using a page, or if you want an external link directly.
After adding the code, you should do this:
1. Create your portfolio items.
2. For each portfolio item, create a new page to present the unique layout you would like.
3. After creating a page, view it, and copy the link
3. Edit the portfolio item, and paste the link into the “Custom URL” field.Now when you view the portfolio page, clicking an item will send you directly to the set URL.
May 14, 2014 at 11:40 am #44353It´s working, thanks. But the breadcrumbs are not functioning properly then.
But I don´t know, if it fits my demands. I gonna try different things.May 15, 2014 at 1:23 am #44623You’re welcome Chris.
July 9, 2014 at 5:20 pm #66859Hi,
This code works great but is there a way to add target_blank so that it opens in a new tab?Cheers
July 10, 2014 at 4:48 pm #67277Hi Ryan,
Sure, just add this code at your customizer’s custom javascript.
jQuery(function($){ $('.page-template-template-layout-portfolio-php .x-portfolio a').attr('target','_blank') });
Cheers.
July 10, 2014 at 5:09 pm #67286Awesome, thanks!
July 11, 2014 at 7:58 pm #67687You’re welcome Ryan!
February 25, 2015 at 5:38 pm #215364You guys are amazing! Just want to remind you that your help is greatly appreciated.
——Hail X Support Team!——
February 25, 2015 at 11:24 pm #215559You’re welcome. Glad we could help and thank you for your kind words.
November 9, 2015 at 8:09 am #6581012 questions on this point:
1. Is there a way to use the Skills used feature that links the skills tags like a portfolio item
2. Is there a way to include the previous / next block with the square up to top level icon
Adding these 2 things really does replace the template
Thanks in advance
November 9, 2015 at 9:12 am #658167Hi Michael,
Thanks for writing in! Regretfully, at this time I am not entirely certain what it is you would like to accomplish based on the information given in your post. If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do (a link to a similar example site would be very helpful, or perhaps some screenshots), we’ll be happy to provide you with a response once we have a better understanding of the situation.
Thank you!
January 15, 2016 at 10:40 am #747777I was looking for a solution to make the portfolio pages full width, and I figured out a pretty simple workaround using custom CSS.
In custom CSS add the code:
.single-x-portfolio .entry-wrap {
width: 100%;
display: block;
}This will push the header of each portfolio item page to take up the whole page at full screen on desktop and push the block of all the other content underneath. So it always functions as if it were being viewed from a mobile device. Hope that helps some people.
The next issue I will look to solve is to be able to make the header image full width or centered when in this configuration, as it’s bound to the left, but this is only an issue on a desktop at full screen, and evn then it’s not that big of a deal.
To see the effect, take a look at one of the portfolio posts here: http://matzeldelaflor.com/portfolio/live-to-tell-docudrama/
January 15, 2016 at 7:00 pm #748322Thanks for sharing Matz!
January 20, 2016 at 1:49 am #754419Hi X Staff,
I tried this code, and it worked perfectly for my first to portfolio items. But when I tried setting up custom pages for the next couple of portfolio items, the link to a custom page no longer works. I.E. if you click on a portfolio item it just sends you back to the same page (Just reloads the page your on); however, the custom page can be found by directly typing in the url. It seems bit odd that it work initially and then stopped working on the consecutive pages. Hope you can help me out.
Thanks,
Caleb
-
AuthorPosts