Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #407935

    Hi everybody,
    I’m making another website using your fantastic theme.
    One question: I’d like to use a portfolio grid as header of my home page, but I don’t want any link on these items. Is that possible?

    #408097

    Hey Gian Maria!

    Thank you for coming back.

    In functions.php try to put the following:

    
    function my_portfolio_title_link ( $title_link, $entry )
    {
    	return '';
    }
    
    add_filter('avf_portfolio_title_link', 'my_portfolio_title_link', 10, 2);
    

    Cheers!
    Günter

    #408142

    Hi Günter, thanks for your reply. Let me understand better:

    1) does you code apply to all my portfolio grids?

    2) How am I supposed to set function.php file since I’m using a child-theme?

    #408155

    Hey!

    Thank you for coming back.

    The code should apply to all portfolio grids.

    If you are using a child theme, put the code in fuctions.php of the child theme.

    Regards,
    Günter

    #408187

    Got it.
    What should I do if I want it to be applied only to that specific portfolio grid?

    #408213

    Hi!

    Thank you for coming back.

    This is a bit difficult, as the filter hook does not have an information about the grid.

    If you know the ID’s of the posts that are involved in the grid you can remove the link from that posts.

    E.g. the posts have the ID’s 234, 250, 280:

    
    
    function my_portfolio_title_link ( $title_link, $entry )
    {
    	$no_link_posts = array (234, 250, 280); 
    	
    	if( in_array( $entry->ID, $no_link_posts ))
    	{	
    		return '';
    	}
    	
    	return $title_link;
    }
    
    

    Or you can limit it to all grids on the current page (you need to know the ID of the page):

    
    function my_portfolio_title_link ( $title_link, $entry )
    {
    	$no_link_pages = array (234, 250, 280); 
    	
    	$page_id = 	get_queried_object_id();
    
    	if( in_array( $page_id, $no_link_pages ))
    	{	
    		return '';
    	}
    	
    	return $title_link;
    }
    

    Best regards,
    Günter

    #408221

    Thanks a lot.
    I try!

    #408229

    I make it in another way: just ovewriting portfolio link setting and linking portfolio item to a # url.
    What do you think? It seems to work.

    #408237

    Hey!

    If it works, it’s fine. If not, my solution should do.

    Cheers!
    Günter

    #412194

    Hi, I’m trying to change things around… How do I know posts/pages ID’s?

    #412203

    Hi!

    You can right click on Chrome or Firefox to inspect elements to find page ID’s http://i.imgur.com/HyPTCRg.jpg

    Regards,
    Yigit

    #412218

    Yes, you’re right…
    Btw, I tried the code suggested by Gunter but it didn’t work: my portfolio grid still has links.

    #412222

    Hey!

    Can you post the link to your page please?

    Cheers!
    Yigit

    #412263

    Hi Yigit, the website is not online yet… just working on it. Don’t worry, I’m doing something else.

    #412297

    Hey!

    Shall we mark the thread as resolved or keep it on hold? :)

    Best regards,
    Yigit

    #412357

    Oh sorry,
    mark it as resolved.
    Thanks for your excellent support.

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Portfolio grid without link’ is closed to new replies.