Forum Replies Created
-
AuthorPosts
-
March 31, 2016 at 2:40 pm in reply to: Enfold: Featured Image with Custom Post Types (CPT) follow up #605904
I am glad I could help. Have fun with Enfold.
March 31, 2016 at 12:04 pm in reply to: Enfold: Featured Image with Custom Post Types (CPT) follow up #605808Have you added the enfold sidebar options and the layout architect to your custom post type edit page? If not this has to be done otherwise the necessary filter avf_builder_elements wont be available to save the setting.
add_filter( 'avf_builder_boxes', 'mmx_avf_builder_for_cpt' ); function mmx_avf_builder_for_cpt( $metabox ) { foreach( $metabox as &$meta ) { if( $meta['id'] == 'layout' ) { $meta['page'][] = 'your_cpt'; $meta['page'][] = 'your_other_cpt'; } if( $meta['id'] == 'avia_builder' ) { $meta['page'][] = 'your_cpt'; $meta['page'][] = 'your_other_cpt'; } } return $metabox; }
- This reply was modified 8 years, 8 months ago by mensmaximus.
March 31, 2016 at 9:34 am in reply to: Enfold: Featured Image with Custom Post Types (CPT) follow up #605731Can you please check whether the checkbox state gets saved on normal posts? And what do you mean with “And here is the functions.php from enfold-folder. I already did some configuration here”? You never, never, never ever may change anything in the functions.php of the parent. You will loose changes with the next update. Any modification has to be done in the functions.php of the child.
And to your second question you do not need to create the code multiple times. Just use the if clause to add more posttypes by either using or syntax ( $post_type == “project” || $post_type == “AN_OTHER_CPT” || $post_type == “AND_EVEN_MORE_CPTS” ) or in_array syntax ( in_array( $post_type, array( ‘project’, ‘AN_OTHER_CPT’, ‘AND_EVEN_MORE_CPTS’ ) ) ).
Sidenote: From your answers and questions I have to assume you do not have a programmers background and deeper wordpress knowledge. Therefore I encourage you to get professional assistance because even if this changes are simple you need to understand what all the code lines mean.
March 30, 2016 at 10:09 pm in reply to: Enfold: Featured Image with Custom Post Types (CPT) follow up #605495Check the name of your CPT. I doubt it is ‘Projects’. It must be the exact name from the register_post_type call. Upper and lower case matters.
March 30, 2016 at 7:50 pm in reply to: Enfold: Featured Image with Custom Post Types (CPT) follow up #605408@tomeez you can simply hook into the filter provided by enfold. Add the following code in your child themes functions.php and change YOUR_POST_TYPE to the name of the cpt you use while registering the custom post type
add_filter( 'admin_post_thumbnail_html', 'mmx_cpt_featured_image_meta'); function mmx_cpt_featured_image_meta( $content ) { global $post, $post_type; if( $post_type == "YOUR_POST_TYPE" ) { $text = __( "Don't display image on single post", 'avia_framework' ); $id = '_avia_hide_featured_image'; $value = esc_attr( get_post_meta( $post->ID, $id, true ) ); $selected = !empty($value) ? "checked='checked'" : ""; $label = '</div><div class="av-meta-extra-inside"><label for="' . $id . '" class="selectit"><input '.$selected.' name="' . $id . '" type="checkbox" id="' . $id . '" value="1" > ' . $text .'</label>'; return $content .= $label; } return $content; }
February 24, 2016 at 5:15 pm in reply to: WC Advanced Quantity – Wrong WooCommerce Hooks in Enfold? #588524You where perfectly clear. What you want is not part of WooCommerce and therefore the setting “multiple of stepvalue” like 5, 10, 15, 20, etc. is not available. Therefore you need to store it in a place where the jquery script could read it. I do not recommend to implement this into Enfold. This should be accomplished with a plugin. However this is out of the scope of this forum.
Oh and I forgot there is a filter for the post navigation entries too:
add_filter( 'avia_post_nav_entries', 'mmx_remove_nav_entries', 10, 2 ); function remove_nav_entries( $entries, $settings ){ $entries = ''; return $entries; }
btw. both filters can be used not only to remove things but to customize ;-)
There is a filter in Enfold to manipulate the breadcrump:
add_filter('avia_breadcrumbs_args', 'mmx_change_home_breadcrumb', 50, 1); function mmx_change_home_breadcrumb($args){ $args['before'] = ''; return $args; }
February 24, 2016 at 4:02 pm in reply to: WC Advanced Quantity – Wrong WooCommerce Hooks in Enfold? #588452In general this can be done. However there has to be more investigation where the “multiples” setting come from (e.g. a plugin) and where this information is stored. The code I provided “just” takes the woocommerce standards as provided e.g with the filter woocommerce_quantity_input_args.
February 24, 2016 at 3:45 pm in reply to: WC Advanced Quantity – Wrong WooCommerce Hooks in Enfold? #588432Maybe my solution will work for you to: https://kriesi.at/support/topic/woocommerce-quantity-selector/#post-588430
Had to solve it early due to customers request ;-)
In /enfold/config-woocommerce/woocommerce-mod.js replace the existing code from line 15 to 38 with the following new code:
jQuery(".quantity input[type=number]").each(function() { var number = $(this), max = parseFloat( number.attr( 'max' ) ), min = parseFloat( number.attr( 'min' ) ), step = parseInt( number.attr( 'step' ), 10 ), newNum = jQuery(jQuery('<div />').append(number.clone(true)).html().replace('number','text')).insertAfter(number); number.remove(); setTimeout(function(){ if(newNum.next('.plus').length == 0) { var minus = jQuery('<input type="button" value="-" class="minus">').insertBefore(newNum), plus = jQuery('<input type="button" value="+" class="plus">').insertAfter(newNum); minus.on('click', function(){ var the_val = parseInt( newNum.val(), 10 ) - step; the_val = the_val < 0 ? 0 : the_val; the_val = the_val < min ? min : the_val; newNum.val(the_val); }); plus.on('click', function(){ var the_val = parseInt( newNum.val(), 10 ) + step; the_val = the_val > max ? max : the_val; newNum.val(the_val); }); } },10); });
The quantity button now wroks with the max, min and step values.
Hi Ismael,
I had not time to work on it yet. I am busy in a large project and wont be able to care about it till end of March.
The solution I can think of is to read the entire input element and to parse it to get the values of min, max and step.
Regards
Michael
January 5, 2016 at 5:55 pm in reply to: WooCommerce products price display when using avia layout architect #560058I have added one more enhancement to the purchase button. Now you can select from the template builder element whether the price should be displayed or not. See the following diff containing the changes from the first diff as well.
+++ product_snippet_button.php 2016-01-05 16:48:15.570861449 +0100 @@ -27,6 +27,21 @@ $this->config['posttype'] = array('product',__('This element can only be used on single product pages','avia_framework')); } + function popup_elements() { + $this->elements = array( + array( + "name" => __("Display price", 'avia_framework' ), + "desc" => __("Should price be displayed?", 'avia_framework' ), + "id" => "display_price", + "type" => "select", + "std" => "yes", + "subtype" => array( + __('yes', 'avia_framework' ) =>'yes', + __('no', 'avia_framework' ) =>'no' + ) + ) + ); + } /** * Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas @@ -57,6 +72,12 @@ */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { + + $atts = shortcode_atts( array( + 'display_price' => 'yes', + ), $atts, $this->config['shortcode']); + extract($atts); + $output = ""; $meta['el_class']; @@ -64,6 +85,12 @@ if(!is_object($woocommerce) || !is_object($woocommerce->query) || empty($product)) return; // $product = wc_get_product(); + if ( $display_price == "yes") { + $price = $product->get_price(); + $html_price = '<p class="price">' . $product->get_price_html() . '</p>'; + $output .= apply_filters( 'avia_purchase_button_html_price', $html_price, $price, $product ); + } + $output .= "<div class='av-woo-purchase-button ".$meta['el_class']."'>"; ob_start(); wc_clear_notices();
Change line 881 in /wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/html-helper.class.php from
$output .= self::$element['data']['save_to']($element);
to
$output .= self::{$element['data']['save_to']}($element);
Update to Enfold 3.4.3 and it will work again :-)
For your convenience: https://kriesi.at/support/topic/php-7-content-section-error/#post-547605
As for now Enfold is not compatible with PHP 7.0. It is no t a big deal and caused by a change to the handling of indirect variables, properties, and methods in PHP 7.0 (see here).
I found several places in classes located in files under /enfold/framework/php where the syntax has to be changed to make enfold compatible with php 7.0.
code like this from class-htmlhelper.php
$output .= $this->$element['type']( $element );
needs to be changed to
$output .= $this->{$element['type']}( $element );
and code like that from html-helper.class.php
$output .= self::$element['type']($element, $parent_class);
needs to be rewritten to
$output .= self::{$element['type']}($element, $parent_class);
I am sure kriesi and his team will fix that in the near future.
Stay tuned and use php5.6. PHP 7 ist still young and should be considered “under development”. It will take some time until hosting companies will introduce php 7.0.
- This reply was modified 9 years ago by mensmaximus.
Solved: I am not sure why but a couple of pages got interpreted as “shop” page. After deleting the “shop” page (the one assigned in woocommerce und products as the main shop page) and recreating/reassigning it everything works as expected.
Update: It was late yesterday. The color section did not solve the issue it just moved the siderbar below the content. So there is definitely a bug.
Because I already solved the issue you can’t see the problem any more. If you activate the fullscreen option in WooThumbs you will get a fullscreen indicator displayed as an overlay to the product image on the single product page. If you click it the lightbox will be triggered, the gray overlay will appear but the product image does not due to Enfolds CSS rule “.mfp-ready .mfp-figure { opacity: 0; }”. Enfold will set the opacity to 1 only if the root container has the css classes mentioned in my post.
Because WooThumbs uses its own implementation of the Maginific Popup script and its own event listener the classes you define in avia.js (mainClass) do not get applied and therefore the opacity is 0. Thus the image is invisible. To be honest this is neither an Enfold nor a WooThumbs problem in means of faulty or bad development. This is one of the major issue in WordPress if it comes to loading resources/scripts that are not part of the core development (like with bootstrap). If many developers use the same scripts you likely get this kind of problems due to unnecessary redundancy that cant be solved unless WordPress bundles the script to be used as dependency.
And because a plugin will always be the second thing to install (a theme is mandatory) I asked the developer of WooThumbs to add either a custom css class to the root container of the lightbox or an option to define additional classes by the user. Either way one can write a more specific css rule or simply apply the classes needed to match the theme rules.
I hope I could describe the problem well enough.
Since I started with minimalistic sites as doorways to promote single services I fall in love with enfold even more :-) my 3rd one is the most minimal as for now: http://wp-fachmann.com/
One more layout for testing lead conversion http://wp-experte.com/
Enfold is the most versatile theme ever. I cant count anymore how many people I convinced about Kriesi and Enfold. And each time I use it I learn something new. How often did I tell you guys you are awesome? Not often enough :-) Today I finished my first One-Page doorway with Enfold: http://wp-spezialist.com/
- This reply was modified 9 years, 6 months ago by mensmaximus.
This reply has been marked as private.This reply has been marked as private.This reply has been marked as private.Use a smaller column to place the form in or use a color section, give it an id and then format the form according to this id.
- This reply was modified 9 years, 8 months ago by mensmaximus. Reason: wrong checkbox selected
This can be achieved by using the filter avia_breadcrumbs_trail. To remove the second breadcrump ( the element with index 1 from the array) put the following code into your functions.php of your child theme:
add_filter( 'avia_breadcrumbs_trail', 'mmx_remove_element_from_trail', 50, 2 ); function mmx_remove_element_from_trail( $trail, $args ) { if ( is_single() ) { unset ($trail[1]); } return $trail; }
The condition of the if statement controls where (page, post, archive, etc.) the removal should take place.
I am not sure whether this is on purpose but this ‘title-shift’ is has been there for ages. Because the demo displays it different or like most people would say ‘correct’ you should consider to fix it or add an option to the element (layout architect) to control the shift.
In addition to Andy’s post i would like to mention the CSS rule provided does only half the job. To make it ‘perfect’ use:
.avia-progress-bar .progressbar-title-wrap { font-size: 0.8em; bottom: 0; left: 0; padding: 1px 10px; }
-
AuthorPosts