Support » Plugin: Visual Portfolio, Posts & Image Gallery » Custom PHP not working

  • Resolved samlaflam

    (@samlaflam)


    Hi,

    I’m trying to use your documentation’sfunction to customise Tiles Gallery and add more columns, but it seems to not working at all.

    add_filter( 'vpf_extend_tiles', 'my_filter_vpf_extend_tiles' );
    
    function my_filter_vpf_extend_tiles( $tiles ) {
        return array_merge( $tiles, array(
            array(
                
                'value' => '6|1,1|1,1|1,1|1,1|2,1|2,1|',
            ),
            
        ) );
    }

    I’m inserting snipet in my function.php and trying to play with values, but nothing happen frontend.

    Once inserted the function, do I have to specify or choose something in particular in the plugin ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author nK

    (@nko)

    Hey.

    Your custom tiles available in a predefined set:

    Such layouts will be resized automatically depending on the screen and container width.

    Regards, nK.

    Hi,

    Yes, I do have this custom layout item, but it seems that values in my function are not working.

    For example I started with ‘value’ => ‘6|1,1|1,1|1,1|1,1|1,1|1,1|’ and it’s not what’s displaying front-end.

    And if I replace ‘value’ with => ‘3|1,0.5|2,0.25|’ it doesn’t change anything front-end.

    So I’m missing something here right ?

    Plugin Author nK

    (@nko)

    Hey.

    Maybe you can give an online example with your custom tiles layout? I can check it and better understand the problem.

    Once you change the value in PHP, it will just change the predefined option. Block will still have an option, that you selected before. To use the newly registered tiles, you need to open a portfolio editor and select it from the list.

    Regards, nK.

    Hi there, I got it, each time I have to update post and open a new portfolio.

    Here is my last question : I’m trying to reproduce this.

    I succeeded to reproduce first raw with this : value’ => ‘6|2,1|1,1|1,1|1,2|1,1|’

    But then I don’t know how to force second raw to be different and finish the layout. You can see it here.

    Plugin Author nK

    (@nko)

    Hey.

    It is a highly specific layout… you should configure all item sizes and limit the number of displayed items.

    I have played with it, something like this one will work better: 6|2,1|1,1|1,1|1,2|1,1|2,0.5|1,2|1,1|2,0.5|1,1|1,1|1,1|.

    Regards, nK.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.