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

    Chris M
    Participant

    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.
    thanks

    Screenshots
    http://www.evernote.com/shard/s1/sh/2af4ed9e-75a1-45a5-b6dc-5ae8bfca3439/3e75917fec6bf5c6e7bfa6c07b22c0b6

    #37259

    Alexander
    Keymaster

    Hi 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.

    #44353

    Chris M
    Participant

    It´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.

    #44623

    Christian
    Moderator

    You’re welcome Chris.

    #66859

    ryan b
    Participant

    Hi,
    This code works great but is there a way to add target_blank so that it opens in a new tab?

    Cheers

    #67277

    Rad
    Moderator

    Hi 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.

    #67286

    ryan b
    Participant

    Awesome, thanks!

    #67687

    Rad
    Moderator

    You’re welcome Ryan!

    #215364

    honestycompany
    Participant

    You guys are amazing! Just want to remind you that your help is greatly appreciated.

    ——Hail X Support Team!——

    #215559

    Christian
    Moderator

    You’re welcome. Glad we could help and thank you for your kind words.

    #658101

    Michael B
    Participant

    2 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

    #658167

    Zeshan
    Member

    Hi 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!

    #747777

    matzeldelaflor
    Participant

    I 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/

    #748322

    Rad
    Moderator

    Thanks for sharing Matz!

    #754419

    LunaticStudios
    Participant

    Hi 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