alexadark
Forum Replies Created
-
Forum: Plugins
In reply to: [Carbon Fields] vertical tabsI tried on 2 websites and it doesn;t work, this is really annoying, i am using a lot the complex field and with all the fields open it’s a real mess
it would be really nice to have all the fields closed by default when you open a page
and don’t understand why the tabbed doesn’;t workForum: Plugins
In reply to: [Carbon Fields] vertical tabsi have updated all my tabbed to tabbed-vertical but it doesn’t work
Forum: Plugins
In reply to: [Carbon Fields] vertical tabsyes i just found that seraching in the code, but it doesn’t work for me ??
Forum: Plugins
In reply to: [Carbon Fields] term_meta custom fieldsGreat!
Thank you
you should have this type of things in the doc, it would be super usefullForum: Plugins
In reply to: [Carbon Fields] term_meta custom fieldsHi,
i have found the solution, and created a function to make it easier
if it can be integrated into carbon fields it would be greatfunction carbon_get_the_term_meta( $taxonomy = 'category', $field_name ) { $term = get_query_var( $taxonomy ); $term = get_term_by( 'slug', $term, $taxonomy ); return carbon_get_term_meta( $term->term_id, $field_name ); }
Forum: Plugins
In reply to: [Carbon Fields] Problem with rich_text FieldGreat it works!
But one thing i don’t understand is that if i don’t want to have wpautop for ex, and want to have a <br> tag to go to the next line, the br is not kept, so it makes the rich_text editor very difficult to use without applying these filtersForum: Plugins
In reply to: [Carbon Fields] Problem with rich_text FieldAlso, the shortcodes doesn’t work in the rich text ??
Forum: Plugins
In reply to: [Carbon Fields] Problem with rich_text FieldCan you please answer to that it;s really a problem
if i want to for ex to write
hello
world
i have to do that
<div>hello</div>
<div>world</div>
if i put a br it doesn’t stay there
and if i simply go to the next line it doesn’t do it
in wordpress editor if i write
hello
world
it will appear like that in the front end , not hereForum: Plugins
In reply to: [Carbon Fields] Activate fields conditionallyIt works !
Forum: Plugins
In reply to: [Carbon Fields] Activate fields conditionallyThank you !
i am going to try !Forum: Plugins
In reply to: [Carbon Fields] Hiding fields to the clientyes i have done that
Forum: Plugins
In reply to: [Carbon Fields] Activate fields conditionallyHi,
yes but i don’t know how to do it…
basically i have this structure
`Container::make( ‘post_meta’, ‘layouts’ )
->show_on_post_type( ‘page’ )
->show_on_template( ‘builder-page.php’ )
->add_fields( array(
Field::make( ‘complex’, ‘crb_block_layouts’ )
/**
* TEXT AREA
*/->add_fields( ‘text_area’, array(
//fields for text area
) )
/**
* SLIDER
*/
->add_fields( ‘slider’, array(
//fields fore slider
))`
then i have the functions to displays them in another files
if for exemple i don’t want to activate the slider how can i write it ?
because if i write a conditional arround it gives me a php error`Container::make( ‘post_meta’, ‘layouts’ )
->show_on_post_type( ‘page’ )
->show_on_template( ‘builder-page.php’ )
->add_fields( array(
Field::make( ‘complex’, ‘crb_block_layouts’ )
/**
* TEXT AREA
*/->add_fields( ‘text_area’, array(
//fields for text area
) )
if(//condition){
/**
* SLIDER
*/
->add_fields( ‘slider’, array(
//fields fore slider
))
}`
but i don’t know how to write my condition, as i say it is a syntax problem
Forum: Plugins
In reply to: [Carbon Fields] dimension images for complex fieldsit’s strange because normally the id is the value which is retrieved by default…
look here : https://carbonfields.net/docs/fields-image/
it says :” set_value_type($value_type)Set the type of the stored value. (defaults to id)
You can also url to store the URL of the image instead of the ID.”
Forum: Plugins
In reply to: [Carbon Fields] dimension images for complex fieldsok, but why do you want to retreive the ID, when carbon fields give you the id by default with his image cf.
it would be simpler to not have the url option (unless you want only the url)
and get the url with :wp_get_attachement_image_url
that is in case you need to have classes to the image like me
if not you can usewp_get_attachement_image
and it outputs all the img code (try it, i have tried all these functions to see what they where doing, i use phpstorm, so when i begin to write theme all it list them all)I have also found this very useful function (which is not in wp, so i add it to my helper functions)
/** * Retrieve parameters from attachments * * @since 1.0.0 * * @param $attachment_id * * @return array */ function wp_get_attachment( $attachment_id ) { $attachment = get_post( $attachment_id ); return array( 'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ), 'caption' => $attachment->post_excerpt, 'description' => $attachment->post_content, 'href' => get_permalink( $attachment->ID ), 'src' => $attachment->guid, 'title' => $attachment->post_title ); }
in case you need the title, the caption etc…
the ‘src’ is the urlForum: Plugins
In reply to: [Carbon Fields] dimension images for complex fieldsHi Dewy, i have just done it too.
personally i prefer to define an image size in my functions and choose this image size
in this case don’t choose set_value_type(‘url’)
then you can use wp_get_attachement_image_url($id,$image_size)
and you can have another cf for the image size
i think it also work with wp_get_attachement_image + it displays also the height and width
i have not used it because i was needing an additional classHope it helps