-
AuthorPosts
-
November 20, 2018 at 1:19 pm #1035579
I have a masonry grid showing posts from multiple post types. At least 1, maybe 2, of the custom post types need to directly open the defined custom link in a new page. I have added the necessary code to the meta.php file to recognise the CPT’s and added the following code to the functions.php so that the additional portfolio settings are visible in the CPT builder page:
add_theme_support('add_avia_builder_post_type_option'); add_theme_support('avia_template_builder_custom_post_type_grid'); add_filter('avf_builder_boxes','yanco_enable_cpt_layout_builder'); function yanco_enable_cpt_layout_builder( $boxes ) { $boxex = array(); $boxes[] = array( 'title' =>__('Avia Layout Builder','avia_framework' ), 'id'=>'avia_builder', 'page'=>array('post','portfolio','page','product', 'enfold_repeatable', 'pdf', 'instagram'), 'context'=>'normal', 'priority'=>'high', 'expandable'=>true ); $boxes[] = array( 'title' =>__( 'Layout','avia_framework' ), 'id'=>'layout', 'page'=>array('post','portfolio','page','product', 'enfold_repeatable', 'pdf' ,'instagram' ), 'context'=>'side', 'priority'=>'low'); $boxes[] = array( 'title' =>__('Additional Portfolio Settings','avia_framework' ), 'id'=>'preview', 'page'=>array('portfolio','post','pdf','instagram'), 'context'=>'normal', 'priority'=>'high' ); $boxes[] = array( 'title' =>__('Breadcrumb Hierarchy','avia_framework' ), 'id'=>'hierarchy', 'page'=>array('portfolio','project_archive', 'pdf', 'instagram'), 'context'=>'side', 'priority'=>'low'); return $boxes; }
However, when i define a custom link on a CPT post, it does not link to the url, but instead links to the blank post page. Please could someone let me know what i have missed?
Thanks,
November 22, 2018 at 4:07 pm #1036581Hey Birdster,
Can you give us temporary admin access? so we can try to take a look at your backend.
Also give us a link to the page where you have applied this masonry grid?
You can post the credentials and link in private content, so it’s only visible to the moderators.Best regards,
NikkoNovember 23, 2018 at 1:27 pm #1036950Nikko,
I’ve added the login details and url to the masonry grid page.Please note, the masonry grid loads posts in a random order, so you may have to scroll down to find the problem post. I have currently added two portrait images, they are the same content, with the same defined custom link. The one that is a portfolio post type links directly to the correct url, however the one that is a pdf post type does not.
I am aware that the easy solution would be remove the custom post type and add all the pdf’s to the portfolio post type, but before i admit defeat – I would really appreciate it if you could explain what i have missed?
Many Thanks,
November 27, 2018 at 3:00 pm #1038024Hi Birdster,
I apologize for the late response.
To be honest I also find it hard to make it work.
You would most likely need to make adjustment on Masonry element to make it work.
Maybe you can take a look at it and maybe try to override it in the child theme.Best regards,
NikkoNovember 27, 2018 at 3:07 pm #1038026Thanks for looking into it Nikko, I guess I will just keep all the pdf links in the portfolio item post type for now.
November 27, 2018 at 4:33 pm #1038064Hi Birdster,
Thanks for understanding.
I think you’ll just have to create a category for it in portfolio and it should work well.Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.