We're merging with GenerateBlocks! Learn more here.

Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • in reply to: Add class to wp-show-posts-single #6727
    Paul
    Participant

    Perfect, thank you, Tom!

    in reply to: Carousel Functionality #6400
    Paul
    Participant

    Hi Tom

    Do you perhaps have a WPSP beta with the carousel function working that I can play with?

    Thanks
    Paul

    in reply to: Set background colour with acf field value #5961
    Paul
    Participant

    Sorry mate, that didn’t work either. No worries though, solved by creating a new div inside wp-show-posts-inner with the custom background colour and adjusting styles of both containers.
    This is what I wanted the blocks to look like:
    https://actondemo47.com/news-list/

    Cheers
    Paul

    in reply to: Set background colour with acf field value #5957
    Paul
    Participant

    BTW, I assumed the hook ‘wpsp_before_wrapper’ refers to the wrapper element around each individual post block, but I guess I’m wrong. I’ve set the news page: https://actondemo47.com/news-list/ to insert a div with a custom colour behind the header and content temporarily so you can see that the code works, but doesn’t make the whole block a custom background colour.

    in reply to: Set background colour with acf field value #5956
    Paul
    Participant

    Hey Tom

    Still trying to get a custom background colour behind each WPSP item. The adjustment above didn’t work, unfortunately.

    As an alternative, I’m trying to insert a div with a custom colour background behind each block using the wpsp_before_wrapper hook like this:

    
    add_action( 'wpsp_before_wrapper','wpsp_add_custom_meta' );
    function wpsp_add_custom_meta()
    {
        $meta = get_post_meta( get_the_ID(), 'background_colour', true );
        if ( isset( $meta ) && '' !== $meta )
    	echo '<div style="background-color:' . $meta . '">';
    }
    
    add_action( 'wpsp_after_wrapper','wpsp_close_div' );
    function wpsp_close_div()
    {
    	echo '</div>';
    }
    

    This doesn’t work – nothing gets inserted. However, replacing wpsp_before_wrapper with wpsp_before_header and wpsp_after_wrapper with wpsp_after_content DOES insert a div with a custom background colour behind the header and content. Not quite what I want, but proves the custom field is working. Just need to target the right element.

    The staging page is here: https://actondemo47.com/news-list/
    Any ideas?

    Thanks
    Paul

    in reply to: Display issue on IE #5928
    Paul
    Participant

    Sadly, no go – used a media query hack to show a different version of the WPSP block on IE only.

    Thanks anyway, Tom

    in reply to: Set background colour with acf field value #5917
    Paul
    Participant

    Hey Tom — alternate idea:

    I can solve this if you can show me how to add the class “.news” to the wp-show-posts-inner element.

    Please let me know.
    Thanks
    Paul

    in reply to: Set background colour with acf field value #5913
    Paul
    Participant

    Sorry Tom, that snippet didn’t work. I substituted my actual acf field name ‘background-colour’ for ‘_my_color’. I then tried setting $color = ‘#666’ to see if a hard-coded hex value would work in case acf wasn’t being set — this added a background colour to the whole wpsp wrapper, not behind each individual item (wp-show-posts-inner).

    Is there another way to dynamically set the background colour of each wp-show-posts-inner element to an acf value from the post?

    Thanks
    Paul

    in reply to: Carousel function #5309
    Paul
    Participant

    Awesome! Looking forward to it. Appreciate the amazing work you’re doing on WPSP and GeneratePress.

    Cheers
    Paul

Viewing 9 posts - 1 through 9 (of 9 total)