Forum Replies Created

Viewing 30 posts - 421 through 450 (of 495 total)
  • Author
    Posts
  • I am glad I could help. Have fun with Enfold.

    Have 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.

    Can 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.

    Check 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.

    @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;
    }
    in reply to: WC Advanced Quantity – Wrong WooCommerce Hooks in Enfold? #588524

    You 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.

    in reply to: Removal of 'You are here' in breadcrumb trail #588505

    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 ;-)

    in reply to: Removal of 'You are here' in breadcrumb trail #588491

    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;
    }
    in reply to: WC Advanced Quantity – Wrong WooCommerce Hooks in Enfold? #588452

    In 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.

    in reply to: WC Advanced Quantity – Wrong WooCommerce Hooks in Enfold? #588432

    Maybe my solution will work for you to: https://kriesi.at/support/topic/woocommerce-quantity-selector/#post-588430

    in reply to: WooCommerce Quantity Selector #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.

    in reply to: WooCommerce Quantity Selector #586730

    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

    I 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();
    
    in reply to: PHP 7 Content Section error #547709

    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);

    in reply to: PHP 7 Content Section error #547616

    Update to Enfold 3.4.3 and it will work again :-)

    in reply to: PHP 7 Issues #547612
    in reply to: PHP 7 Content Section error #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.

    in reply to: Custom sidebar setting per page #537234

    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.

    in reply to: Custom sidebar setting per page #537198

    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.

    in reply to: WooThumbs Support #509534

    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.

    in reply to: Enfold Showcase #483024

    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/

    in reply to: Enfold Showcase #470542

    One more layout for testing lead conversion http://wp-experte.com/

    in reply to: Enfold Showcase #462266

    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.
    in reply to: Easy Slider Post Title and Excerpt vanished #440797
    This reply has been marked as private.
    in reply to: Easy Slider Post Title and Excerpt vanished #440772
    This reply has been marked as private.
    in reply to: Easy Slider Post Title and Excerpt vanished #440036
    This reply has been marked as private.
    in reply to: Size of contact-form on specific URL #427509

    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
    in reply to: Nicht kompatibel mit wpSEO #427219
    in reply to: Remove "Category" from breadcrumb #426142

    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.

    in reply to: Progress bar title is a little OFF #425181

    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; 
    }
Viewing 30 posts - 421 through 450 (of 495 total)