Tagged: portfolio grid
-
AuthorPosts
-
March 9, 2015 at 10:00 am #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?March 9, 2015 at 2:29 pm #408097Hey 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ünterMarch 9, 2015 at 3:17 pm #408142Hi 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?
March 9, 2015 at 3:25 pm #408155Hey!
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ünterMarch 9, 2015 at 3:50 pm #408187Got it.
What should I do if I want it to be applied only to that specific portfolio grid?March 9, 2015 at 4:20 pm #408213Hi!
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ünterMarch 9, 2015 at 4:29 pm #408221Thanks a lot.
I try!March 9, 2015 at 4:36 pm #408229I 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.March 9, 2015 at 4:46 pm #408237March 16, 2015 at 3:18 pm #412194Hi, I’m trying to change things around… How do I know posts/pages ID’s?
March 16, 2015 at 3:23 pm #412203Hi!
You can right click on Chrome or Firefox to inspect elements to find page ID’s http://i.imgur.com/HyPTCRg.jpg
Regards,
YigitMarch 16, 2015 at 3:36 pm #412218Yes, you’re right…
Btw, I tried the code suggested by Gunter but it didn’t work: my portfolio grid still has links.March 16, 2015 at 3:38 pm #412222March 16, 2015 at 4:25 pm #412263Hi Yigit, the website is not online yet… just working on it. Don’t worry, I’m doing something else.
March 16, 2015 at 4:57 pm #412297March 16, 2015 at 5:41 pm #412357Oh sorry,
mark it as resolved.
Thanks for your excellent support. -
AuthorPosts
- The topic ‘Portfolio grid without link’ is closed to new replies.