• Resolved alissit

    (@alissit)


    Hi, this is great – so simple!

    How can I enable this on CPT’s? I’ve tried adding “single”, “single-{post-type}” etc. but can’t get it to work on a CPT I created using ACF.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Martin von Berg

    (@martinvonberg)

    Hi,

    You have to add the CSS-class of your image / video to the list. Could you please send me HTML of your page as an example? Or a link?

    I’ll add this to my TODO-list. Currently I’m working on:

    • stop running videos on Open and on Slide Change (parallel running videos is annoying in my opinion)
    • Yes, and provide Admin settings or restore after update after several requests.
    • Your proposal. Could you please send me HTML of your page as an example?

    Best Regards

    Martin

    Thread Starter alissit

    (@alissit)

    Hi Martin,

    Yes, I’ve added the proper CSS class to the JSON, and it’s working perfectly on pages, but not on CPT’s.

    Looking at Dev tools, I can see the JS being added on the pages, but on the CPT the JS doesn’t load at all.

    I’m assuming because CPT’s aren’t normal post-types, they aren’t supported yet?

    You can see it working properly on this page:
    https://eleanorspensart.co.uk/gallery/

    But here’s a CPT where it’s not working:
    https://eleanorspensart.co.uk/gallery-piece/crows-gathering/

    I’m using the same CSS class on both URL’s.

    Here’s the JSON – I’ve tried adding ‘gallery-piece’, as that’s the CPT name, but it’s not working. It doesn’t work no matter what combination I’ve tried.

    {
        "$schema": "./settings/settings-schema.json",
        "hrefTypes": [
            "Empty",
            "Media"
        ],
        "postTypes": [
            "page",
            "post",
            "home",
            "front",
    		"gallery-piece"
        ],
        "cssClassesToSearch": [
            "wp-block-image",
    		"gallery-piece-image",
            "wp-block-media-text",
            "wp-block-video",
            "postie-image",
            "wp-block-embed-youtube",
    		"page-header-image-single"
        ],
        "excludeIDs": [
            0
        ]
    }
    Plugin Author Martin von Berg

    (@martinvonberg)

    Hi,

    I’d appreciate to help you. The two pages look identical concerning the HTML. Did you try to add “gb-block-image” as CSS-Class to add to “cssClassesToSearch”?

    I installed ACF but unfortunately CPT are only possible in ACF Pro. So, I can’t test the behaviour with CPT and ACF free. I don’t want to buy ACF Pro just for testing. Any idea how to circumnavigate this?

    Best Regards

    Martin

    Thread Starter alissit

    (@alissit)

    Hi Martin,

    I can give you access to the site if you want to log in and have a play with it?

    Alternatively, the plugin Custom Post Types creates the exact same CPT that ACF Pro does. That’s just a new feature that they’ve released, but they are implemented the same way that the CPT plugin handles them (I think)

    Plugin Author Martin von Berg

    (@martinvonberg)

    Used theme: GeneratePress + GenerateBlocks + ACF. All Pro versions.

    test?result: The?plugin?is?working,?as?intended.

    post-type?=?gallery-piece?—>?OK, defined by ACF and in plugin-settings.json.

    content of the page?https://eleanorspensart.co.uk/gallery-piece/crows-gathering/?stored in database is : ?<p>Size : 12.5 x 13.5″</p>. Nothing more. No figure-tag to handle –> The WP-PI “Simple Lightbox for WordPress” uses “the_content” filter to modify the post / page etc.

    In WordPress it is obviously standard that themes provide content for post / pages etc. that is not stored in the database and so not shown as “the_content”.

    I had to massively change my plugin to handle that. As shown here (final answer):?https://wordpress.stackexchange.com/questions/52840/filter-all-html-output.
    This will have impact on all other users using the PI. And change all existing output of other pages. Usually things one won’t expect for such a simple plugin.

    I close your request for now, as the Plugin is working correctly. Please contact me if you need further support.

    Plugin Author Martin von Berg

    (@martinvonberg)

    With V2.0.0 this feature will be implemented.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom Post Types’ is closed to new replies.