-
AuthorPosts
-
October 2, 2015 at 2:33 pm #608534
I am using the Portfolio template and files as a base to design a new page template. I have the template design added, the meta box for it added, and showing based on the template selected. However, I’m not sure how I can get around adding more cases to the
meta/setup.php#x_create_meta_box
function. It doesn’t work just including the file in the directory, or requiring it into the child theme’sfunction.php
since the parent theme is usingrequire_once
. I would appreciate some help, thanks in advance!October 2, 2015 at 6:03 pm #608742Hi there,
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.
October 7, 2015 at 4:45 pm #615700Apologies for not providing enough details to explain the problem. I will try to do better explaining what the problem is this time.
NOTE: All new files and modification are being added in the child theme
I like the Portfolio layout but want it to pull based on Post Type rather than a Portfolio Category. In order to do this and keep the Portfolio functionality, I am recreating the Portfolio layout as a new type called Announcements. I have the new layout (Announcements) created and displaying as an option in the page template selection. I have created a Announcements Meta-Box exactly like the Portfolio Meta-Box and have modified the jQuery script to only show the Announcements Meta-Box when the Announcements template is selected.
No issues up to now, but here lies the problem. The new Announcements Meta-Box that I have created links all the settings to the portfolio setting names. I want to change these to be specific to announcements. In order to do this I need to add a couple cases to the switch case(in
framework/functions/global/admin/meta/setup.php#x_create_meta_box
) that builds the setting fields. Unfortunately, this file is being included usingrequire_once( $admn_path . '/meta/setup.php' );
inframework/functions.php
.I am extremely unsure of how I can overwrite/add to the switch case the cases that I need. Perhaps there is a better way to create a new Meta-Box with the custom fields that I need. I am wanting to add
case 'select-announcements-category' :
andcase 'radio-announcements-layout' :
(Variations of the portfolio cases).Thank you for your help!
October 7, 2015 at 10:58 pm #616005Hello There,
Thanks for the clarification! Regretfully, you won’t be able to override the function in the child theme. You have to edit the parent theme so that you can add those case ‘select-announcements-category’ : and case ‘radio-announcements-layout’ : (Variations of the portfolio cases).
As this is all custom development, regretfully we won’t be able to assist further. Custom development is outside the scope of our support. We’re happy to provide advice and get you started in the right direction, but you would still be responsible for the implementation.
For more assistance, you might want to contact our trusted partners who caters X setup and customization needs. Please see Our Trusted Customization Partners.
Thank you for your understanding.
October 8, 2015 at 4:08 am #616327Thank you, I managed to work it out but I’m left guessing why you wouldn’t make this easy to overwrite using a child theme.
For instance:
– pluggable functions that check if they are defined before attempting to create
– Making use ofget_stylesheet_directory()
orget_stylesheet_directory_uri()
– Relative paths on the require_onceIn the end, I copied the files to the child theme that I was wanting to overwrite, renamed the functions that needed changed, and removed the other functions. This essentially created a custom flow for my announcements as opposed to building it into the flow the other meta-boxes use.
October 8, 2015 at 5:13 am #616383Hi there Stramel,
Hope you’re well today, glad to hear you found a way that works for you. 🙂
I’ve passed along your feedback to the development team for future consideration.
Thanks!
-
AuthorPosts