Forum Replies Created
-
AuthorPosts
-
Thanks Josue,
This helps me indeed to see all the post custom fields inside the editing screen in the backend.
However, this does not solve my real problem.In the Avia Layout Builder I try to get all these custom fields as well.
I created a new custom element for the Avia Builder: “Custom Field”.
In there I want to create som post element to pop up when clicking the element (after inserting it).
I am not able to get all of the available custom fields of the current post.
First (simple) thing to do is “var_dump” the post ID.
Whatever I try by getting the $post->ID it always returns NULL.I hope the problem is clear: I cannot get current post information inside an ALB element.
Regards,
JanHi Ismael,
Thanks.
I inserted the snippet into the functions.php of my child theme.
Than, when I open a post in the backend it shows me the array of all custom fields.
Also, var_dump($id) shows me the post-id of the pos, currently edited.So far so good.
Now I take the same code (from “global” to “var_dump”) and put it in popup_elements of the shortcode file blog.php.
When opening the post and inserting Blog_posts element and clicking it, all i see is “bool (false)”.So inside the Avia Layout Builder, it wo’t show the custom fields (or $id).
Or is there something I am missing here?Regards,
JanThanks Ismael,
What I try to accomplish:
I am developing another function / element for the Advanced Layout Builder:
Get more info of the post I am editing. I want to create a drop-down selection field for the element, that show me the available custom fields, that I than can show on the frontend page of that post.I already started a (closed) thread for the particular custom fields items.
But I have to find out myself or hiring a freelancer for this.
I started developing the function myself.
But I get stuck on the first thing to do: I need to get the current post-ID in the backend (editing the post).
I tried all tips in the forum (including the things you mention), but they seem to be working only on frontend (the-loop).
In backend these thing give me NULL of boolean(false) as result.So my primary question is: How do I get the post-ID of the currently edited post in backend?
Best regards,
JanHi Ismael,
Thanks.
This topic can be closed.Jan
Hi,
Thanks for the answers.
I understand, that what I am asking, is beyond the scope of support.To be clear:
– I am focussing on backend right now. Frontend will be nest step (loop-index.php).
– I do want to use the Avia Framework.
– Everything has to be coded in the child theme.I have built many websites using Enfold, and first thing after installation Enfold is creation of that Child Theme.
All modifications to the theme, that I make, are doen in the child theme.I will look into it myself.
One question, though: Is there any documentation on the Avia Framework.
Explanation of the array structure and the typical usage in Avia elements would be of great help.
@Storyblock: Thanks for the offer, but I am not capable of hiring people at this moment.Thanks again,
Jan- This reply was modified 8 years, 5 months ago by JB_Walton.
Hi Ismael,
Thanks for your reply.
I have been looking around and figured out the way I want it:- I want to use a typical enfold / avia solution.
- I use a child theme, so I added the shortcodes code in functions.php of the child theme.
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
- I want to add a content element (post-custom-field) to add a special element in the avia layout builder. Therefore I created a special post_custom_fields.php in the directory enfold-child/shortcodes.
I want to choose one of the available custom fields of that post in a drop down list.
So I try to create that drop-down list, and need to fill an array with the meta-key of each custom field. Choosing the meta-key should result in showing the meta-value in frontend. Styling will be no problem.I have problems creating the dropdown list now.
I only see the “Select One” in my dropdown list.My code at the moment:
function popup_elements() { /* jan */ /* add dropdown list for custom fields */ $custom_fields = get_post_custom(); $all_custom_fields[ 'Select One' ] = null; if ( !empty($custom_fields) && !is_wp_error ($custom_fields) ) : foreach ($custom_fields as $custom_field ) : $all_custom_fields [meta_id] = "__('$custom_field->meta_key', 'avia_framework') => '$custom_field-meta_key'"; endforeach; endif; $this->elements = array( array( "name" => __("Do you want to display custom post fields?", 'avia_framework' ), "desc" => __("Do you want to display custom post fields available in the post?", 'avia_framework' ), "id" => "cust_field_name", "type" => "select", "std" => "Quotes", "subtype" => $all_custom_fields ),
I’m still diving into the code, to figure out the problem.
But perhaps you can see the problem.EDIT:
I want to access all custom fields from the current post, but the post_ID of the current post equals NULL.
I searched and saw that that global variables of WordPress do not work in the Avia Layout Builder.
Is that anyhow possible?Thanks again,
Jan- This reply was modified 8 years, 5 months ago by JB_Walton.
Hi Ismael,
One member of the choir did test it on an Asus Tablet, with the Asus browser.
I do not know what type exactly or how old the tablet is, she works on.
So I asked the member of the choir to use Chrome (google) and she told me, that the site was working correct there.
After that I checked your forum and saw that other people had some problems on tablets in the past.I used crossbrowsertool.com, check this link
The output on most devices was all right, but on the Samsung Galaxy Tab 2 and 4 (both 10.1) was a problem.Screenfly does not check like crossbrowsertool. Screenfly only adjusts the viewport size, not the useragent.
Hopefully this helps.
JanHi Devin,
Thanks for the answer.
The oages are indeed created by WooCommerce.
For now I installed the bbp login widget to use in a sidebar position.
That works.
And i created a menu as seconb menu, that is displayed now at the top of my page.
Seems to be enough for me, now.
Thanks again,
Jan
-
AuthorPosts