• Resolved tacticjuls

    (@tacticjuls)


    Hey,

    I create a custom .php page… i make a OWL Carousel with differents post.
    I have the thumbnail, the title, and i want to add the “ADD TO LIST” buton via code.
    I only found the “LIST BUTTON”

    <?php
    $arg = array (
        'echo' => true
    );
    do_action('gd_mylist_btn',$arg);
    ?>

    Is something like this but for the ADD TO LIST button?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Andrea Greco

    (@andygi)

    Hello,

    the code you show me is the correct one in order to show the button by code, but I never use it into a carousel.
    Honestly I don’t think it is works strand away, you need a workaround for that, because I use handlebar+jquery to render the button.
    I don’t know which plugin you use for the carousel, but usually for this kind of task you need to render the button after the carousel.
    You can try with the original code, you can find it in my github repo (at Details page of the WP page)

    Cheers

    Thread Starter tacticjuls

    (@tacticjuls)

    Thanks for your answer… I’m trying this in a Page where i have a foreach of post, so i want to impement the botton to add to list in each post:

    <?php
    $arg = array (
        'echo' => true,
        'item_id' => $customPost->ID
    );
    do_action('gd_mylist_btn',$arg);
    ?>

    But when i go to the page the button do not appear. Do you know what can be happening?

    Thank you!

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

    (@tacticjuls)

    Done.

    <?php echo do_shortcode('[show_gd_mylist_btn item_id= '. $customPost->ID . ']'); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add button “Add to list” to a custom page.’ is closed to new replies.