Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • I would also like to be able to choose a regular simple extension .webp

    Thread Starter Ivan

    (@maflman)

    Thank you very much for your help.
    I tried the PODS plugin for CPT and created a simple Gutenberg gallery, but even in this case it didn’t work. So it means that you are probably right and the problem will be hidden somewhere else. I just don’t know where …
    In my opinion, my theme is not complicated at all. In functions.php I have only a few basic things:

    <?php
    
    function thalia_files()
    {
        wp_enqueue_style('main_styles', get_theme_file_uri('/build/style-index.css'), NULL, time(), 'all');  // , NULL, time(), 'all' - jen pro Development
        wp_enqueue_style('custom-google-style', 'https://fonts.googleapis.com/css2?family=Mulish:wght@200;300;400;500;600;700;800;900&display=swap');
        wp_enqueue_script('main_js', get_theme_file_uri('/build/index.js'), NULL, microtime(), true);
        wp_localize_script('main_js', 'thaliaData', array(
            'site_url' => esc_url(site_url()),
            'nonce' => wp_create_nonce('wp_rest')
        ));
    }
    
    add_action('wp_enqueue_scripts', 'thalia_files');
    
    function thalia_features()
    {
        add_theme_support('title-tag'); 
        add_theme_support('post-thumbnails');
        add_image_size('hero-post', 1920, 550); 
        add_post_type_support('page', 'excerpt');
        add_image_size('nahledy', 400, 300, true);
    }
    
    add_action('after_setup_theme', 'thalia_features');
    

    And in Photoswipe settings is my CPT in “Available post types on this site:”

    Now I remember having a similar problem on another website where I had CPT and Photoswipe Lightbox. It all worked well, but about a year ago it stopped working, I still don’t know why …
    I would like to solve this problem because this is my favorite Lightbox for WordPress.

    I will try to contact you via email.

    • This reply was modified 3 years, 3 months ago by Ivan.
    Thread Starter Ivan

    (@maflman)

    Thank you for your answer.
    I noticed one more thing. Lightbox does not work on Custom Post Types. In this case, it is called a “produkt”.

    function produkt_post_types()
    {
        register_post_type('produkt', array(
        	'show_in_rest' => true,
            'public' => true,
            'supports' => array('title', 'editor', 'thumbnail'),
            'rewrite' => array('slug' => 'produkty'),
            'has_archive' => true,
            'public' => true,
            'labels' => array(
                'name' => 'Produkty',
                'add_new_item' => 'Add New Produkt',
                'edit_item' => 'Edit Produkt',
                'all_items' => 'V?echny Produkty',
                'singular_name' => 'Produkt'
            ),
            'menu_icon' => 'dashicons-pressthis',
        ));
    }
    add_action('init', 'produkt_post_types');
    • This reply was modified 3 years, 3 months ago by Ivan.
    Thread Starter Ivan

    (@maflman)

    I did a terrible hack, but it works.

    add_filter('the_content','new_content');
    function new_content($content) {
        $content = str_replace('<figure><a','<figure><a data-lbwps-width="1000" data-lbwps-height="800" data-lbwps-handler="0" ', $content);
        return $content;
    }

    Thanks again!

    Thread Starter Ivan

    (@maflman)

    Thank you very much ??.
    I did a quick test and the lightbox works.
    Now I need to implement attributes properly. Either via Javascript setAttribute or extend the existing Gutenberg Gallery block. I don’t know yet…
    That will be my next challenge ??

    Enable “Sort Gallery” button again in Gallery -> Options -> Gallery page -> Sort options clicking on “Custom order”

Viewing 6 replies - 1 through 6 (of 6 total)