htmlBurger
Forum Replies Created
-
Forum: Plugins
In reply to: [Carbon Fields] Fatal ErrorHi @shawnd1007,
Please, let us know if you have further issues, and if you do, please send some more details on how to reproduce the issue.
Thank you.
Forum: Plugins
In reply to: [Carbon Fields] Sidebar on the flyHi @knath632,
Can you please provide more details about what you need to do, and probably some more code?
Forum: Plugins
In reply to: [Carbon Fields] problem with complex fields groupsThis makes sense, feel free to submit a new feature request in the Issues section in the GitHub repo: https://github.com/htmlburger/carbon-fields/issues
Forum: Plugins
In reply to: [Carbon Fields] problem with complex fields groupsHello @alexadark,
We’re constantly working on improving the documentation. So yes, more examples and guides will be included in the future.
Thanks.
Forum: Plugins
In reply to: [Carbon Fields] problem with complex fields groupsOkay, please try replacing your display functions with these:
function wst_display_fields() { $layouts = carbon_get_the_post_meta( 'crb_layouts', 'complex' ); foreach ( $layouts as $layout ) { $function_name = 'wst_display' . $layout['_type']; if ( function_exists( '$function_name' ) ) { call_user_func( $function_name, $layout ); } } } function wst_display_driver($layout) { $licence = $layout['license']; $name = $layout['name']; ?> <h2>Driver</h2> <?php echo $name; ?><br> <?php echo $licence ?><br> <?php } function wst_display_teacher($layout) { $picture = $layout['picture']; $year = $layout['years_of_experience']; ?> <h2>teacher</h2> <img src="<?php echo $picture ?>" alt=""> <?php echo $year; }Note: best practices suggest that you should check any data for existence before displaying it. Also, the display functions currently lack some escaping and sanitization (https://codex.ww.wp.xz.cn/Validating_Sanitizing_and_Escaping_User_Data) – you’ll probably want to do that as well.
Please, let us know if you need further assistance.
Forum: Plugins
In reply to: [Carbon Fields] problem with complex fields groupsHello @alexadark,
Actually, it appears that the problem is exactly the displaying of field groups.
Feel free to change your wst_display_fields() function to what we’ve provided in the demo code above.
Please, let us know if you’re having further issues.
Forum: Plugins
In reply to: [Carbon Fields] Fatal ErrorHeey @shawnd1007,
We’re unable to reproduce the issue.
Can you please:
- Provide a list of all plugins that you have installed and activated.
- Send the code that you’re using for your nav menu container and fields
- Send a step-by-step list of what you do when the issue occurs.
Thanks in advance.
Forum: Plugins
In reply to: [Carbon Fields] problem with complex fields groupsHey @alexadark,
You can name your section functions like this:
render_section_four_block_posts(),render_section_two_col_posts()etc.Then, when rendering the complex fields, you have the
_typearray value. You can use it to get the type of a complex section, then to call the correct section rendering function. So it would be something like this:$data = carbon_get_post_meta( get_the_ID(), 'crb_block_layouts', 'complex' ); foreach( $data as $entry ) { $function_name = 'render_section' . $entry['_type']; if ( function_exists( $function_name ) ) { call_user_func( $function_name, $entry ); } }Please, let us know if you need additional help.
Forum: Plugins
In reply to: [Carbon Fields] Fatal ErrorHi @shawnd1007,
Yes, this code is necessary for the nav menu item custom fields to save properly.
Can you please let us know which multilingual plugin are you using?
Thanks.
Forum: Plugins
In reply to: [Carbon Fields] CF for "page building"?Hi @doup,
We’re not aware of any public plugin that builds on top of Carbon Fields.
But if anyone has built one, this is the perfect spot to share it.
Anyway, we’re glad you like our plugin, and would appreciate any feedback that you might have.
Have fun!
Forum: Plugins
In reply to: [Carbon Fields] problem with association fieldsHi @dewy,
We believe you’ll need to organize your fields in a little different way to make it easier to display in the front end. Here is how we envision it:
1. Create a complex field with a Select field in it. That select field would allow you to select a term.
2. In the complex field, there should be an association field that would allow you to select posts. These will be the posts that will appear under each term.Then, when displaying that complex field in the front end, you will easily display each term and its corresponding posts.
Forum: Plugins
In reply to: [Carbon Fields] problem with association fieldsHi again,
We’re unable to understand what you mean by this:
with this code i want in a list the term with the post.Can you please clarify? An example will probably be helpful.
Forum: Plugins
In reply to: [Carbon Fields] Keep same dynamic sidebar setting as blogHi @knath632,
This functionality is not related with Carbon Fields. You’ll have to build your own custom logic to handle this.
We can recommend that make your choose sidebar field accessible from all of your theme (store it as a theme option, or have another way of easy fetching it without hardcoding a post ID). Then, render that sidebar using
dynamic_sidebar()in a sidebar file, and callget_sidebar()in all templates where you want it. For example, if you name your sidebar filesidebar-custom.php, you can call with the following code in your archive, category and single page templates in your theme:get_sidebar( 'custom' );Please, let us know if you have further questions.
Forum: Plugins
In reply to: [Carbon Fields] problem with association fieldsHi @stardeuche,
Can you please describe what you need to do in short? An example would also be helpful.
Thanks.
Forum: Plugins
In reply to: [Carbon Fields] Set default templateHi @knath632,
When you want to set your container to the default template, use
default, like this:->show_on_template('default')and if you want you can use it with an array of templates, like this:
->show_on_template(array("home.php", 'default', "blog.php", "twocolumn.php"))