Forum Replies Created

Viewing 15 replies - 31 through 45 (of 58 total)
  • thanks I prefer to wait for a fix release through www.remarpro.com

    I personally am not using any plugins for translations and yet I have the issue. It worked before.

    I have the same problem. Using a theme called Waveme theme.

    Thread Starter julianoe

    (@julianoe)

    Indeed I did not think of jQuery unwrap. I will try that.

    And I will try to see if I can register my own component to understand all that more thoroughly.

    Thread Starter julianoe

    (@julianoe)

    I was about to post that comment : That’s way better! Another way to optimize that would be real nice would be not to enqueue AOS scripts and styles if not used and not enqueue FontAwesome file if not used. I only use button with custom SVG icons and that comes adding requests and weight that is not used on the website :/

    But I just realize: do you really add the button with javascript on the front??? When I dequeue the AOS script (I use AOS from another plugin and don’t need to have it 2 times loaded), the button disappears…

    Thread Starter julianoe

    (@julianoe)

    It works! thanks!

    Thread Starter julianoe

    (@julianoe)

    Thanks for taking the time to answer.
    I want to apply to that WordPress project a component that uses a list of radio inputs and labels all on same DOM level to use CSS for a simple star rating system (see here)

    The fact that the component wraps every input/label pair into an individual div makes it impossible to do it like that. That’s why I just want to get rid of the wrapping div and be able to choose the output.

    I did not see in the docs how I can create my own control/component to manipulate the data that the users inputs into the radio

    Thread Starter julianoe

    (@julianoe)

    Thanks that’s perfect! Honestly the core team should draw some inspiration from the work on that plugin.. the button block is so far behind

    Thread Starter julianoe

    (@julianoe)

    I wanted to contribute translations before seeing there already was a translation and that it was just pending. Let’s wait then.

    Thanks for the answer.

    Thread Starter julianoe

    (@julianoe)

    Sorry I did not have the time to answer. Did you manage to achieve what you wanted to do?

    Thread Starter julianoe

    (@julianoe)

    Hi @markdimi !

    In my case what I wanted to do was add the filters on a “clients” CPT archive page.

    First of all refer to the /inc/template-tags.php in the parent theme and look at the function called eksell_the_archive_filter()

    What I did was remove this function via an action for my specific post type (added in the functions.php of my child theme:

    /* Remove original theme filter function for Clients post type */
    add_action('template_redirect', 'markdimi_remove_filters_on_clients_archive', 15);
    function markdimi_remove_filters_on_clients_archive(){
        if ( is_post_type_archive('clients')){
            remove_action('eksell_archive_header_end', 'eksell_the_archive_filter', 10);
        }
    }

    As I used the default taxonomy “category”, my filters displayed empty ones.
    So I used this utility function to get the list of terms that are going to be used as filters (source : https://wordpress.stackexchange.com/a/391267)

    function get_terms_by_posttype($taxonomy, $postType) {
        // Get all terms that have posts
        $terms = get_terms($taxonomy, [
            'hide_empty' => true,
            'depth'     => 1
        ]);
    
        // Remove terms that don't have any posts in the current post type
        $terms = array_filter($terms, function ($term) use ($postType, $taxonomy) {
            $posts = get_posts([
                'fields' => 'ids',
                'numberposts' => 1,
                'post_type' => $postType,
                'tax_query' => [[
                    'taxonomy' => $taxonomy,
                    'terms' => $term,
                ]],
            ]);
    
            return (count($posts) > 0);
        });
    
        // Return whatever we have left
        return $terms;
    }

    And then we add our own modified function that will display our modified list of filters for our custom post type.

    if ( ! function_exists( 'markdimi_the_archive_filter_clients' ) ) :
    	function markdimi_the_archive_filter_clients() {
    
            if ( ! is_post_type_archive('clients')) return;
    		
    		// Check if we're showing the filter
    		if ( ! eksell_show_home_filter() ) return;
    
    		$filter_taxonomy = ( is_post_type_archive( 'jetpack-portfolio' ) || is_page_template( 'page-templates/template-portfolio.php' ) ) ? 'jetpack-portfolio-type' : 'category';
    
    		$terms = get_terms_by_posttype( 'category', 'clients' );
    
    		if ( is_wp_error( $terms ) || ! $terms ) return;
    
    		$home_url 	= '';
    		$post_type 	= '';
    
    		// Determine the correct home URL to link to.
    		if ( is_home() ) {
    			$post_type 	= 'post';
    			$home_url 	= home_url();
    		} elseif ( is_post_type_archive() ) {
    			$post_type 	= get_post_type();
    			$home_url 	= get_post_type_archive_link( $post_type );
    		} else if ( is_page_template( 'page-templates/template-portfolio.php' ) ) {
    			$post_type 	= 'jetpack-portfolio';
    			$home_url 	= get_post_type_archive_link( $post_type );
    		}
    
    		// Make the home URL filterable. If you change the taxonomy of the filtration with <code>eksell_home_filter_get_terms_args</code>,
    		// you might want to filter this to make sure it points to the correct URL as well (or maybe remove it altogether).
    		$home_url = apply_filters( 'eksell_filter_home_url', $home_url );
    	
    		?>
    
    		<div class="filter-wrapper i-a a-fade-up a-del-200">
    			<ul class="filter-list reset-list-style">
    
    				<?php if ( $home_url ) : ?>
    					<li class="filter-show-all"><a class="filter-link active" data-filter-post-type="<?php echo esc_attr( $post_type ); ?>" href="<?php echo esc_url( $home_url ); ?>"><?php esc_html_e( 'Show All', 'eksell' ); ?></a></li>
    				<?php endif; ?>
    
    				<?php foreach ( $terms as $term ) : ?>
    					<li class="filter-term-<?php echo esc_attr( $term->slug ); ?>"><a class="filter-link" data-filter-term-id="<?php echo esc_attr( $term->term_id ); ?>" data-filter-taxonomy="<?php echo esc_attr( $term->taxonomy ); ?>" data-filter-post-type="<?php echo esc_attr( $post_type ); ?>" href="<?php echo esc_url( get_term_link( $term ) ); ?>"><?php echo $term->name; ?></a></li>
    				<?php endforeach; ?>
    				
    			</ul><!-- .filter-list -->
    		</div><!-- .filter-wrapper -->
    
    		<?php 
    
    	}
    	add_action( 'eksell_archive_header_end', 'markdimi_the_archive_filter_clients' );
    endif;

    Don’t forget the action at the end ??

    I hope it helps.

    • This reply was modified 2 years, 10 months ago by julianoe.
    • This reply was modified 2 years, 10 months ago by julianoe.
    Thread Starter julianoe

    (@julianoe)

    Thanks for putting me on the track. I created a nice child theme that allows to have the filters for the archive page of my custom post types.

    It does not seem like anyone will maintain this anymore ??
    Do you people know of plugins or techniques that can be used to achieve something similar? Would be useful to link them somewhere in the forums associated with CPT-onomies as I’m pretty sure this still covers some use cases for WordPress advanced users.

    • This reply was modified 2 years, 10 months ago by julianoe.

    This actually helped me just a few minutes after you posted it haha!

    Thread Starter julianoe

    (@julianoe)

    I had to disable the server cache. Clients seing the cart info from other clients is not possible.

    The issue is still going on : with nginx server cache enabled, even a script refreshing the woocommerce fragments does not seem to work and the menu cart does not display the right number.

    I’m surprised no one ever raised this issue as using server cache is a huge performance gain.

Viewing 15 replies - 31 through 45 (of 58 total)