• Hi, I want to put the slider shortcode in my template and load the slider ID from a meta field in my post editor.

    For example, if I want to load slider ID 5, I would put “5” in the custom meta field in my post editor, and the plugin should know to load slider #5.

    I really love your plugin and would like to use it on my website, and I would would be great full if you can steer me in the right direction.

    Thanks!!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor averta support

    (@averta_support)

    Hi,

    Thank you for choosing Master Slider.

    You can use the below code to load Master Slider:

    <?php masterslider(5); ?>

    “5” is slider ID and it can be loaded from saved meta.

    If I could be of any further assistance, please let me know.

    Best,
    Averta

    Thread Starter marv2

    (@marv2)

    Hi, based on the code you provided, I tried appending using it like the following but it gives me an error: Invalid slider id. Master Slider ID must be a valid number.

    $store_meta[‘gallery’] = masterslider( absint( $gallery_id ) );

    Any assistance would be appreciated.

    Plugin Contributor averta support

    (@averta_support)

    Hi,

    Could you please check out slider ID again?

    Best,
    Averta

    Thread Starter marv2

    (@marv2)

    Hi, thanks for the reply.

    The slide ID is correct. In fact, I tried it with all my side IDs and got the same error.

    Plugin Contributor averta support

    (@averta_support)

    Hi,

    You need to save slider ID as meta, then use it for loading slider.

    Also, you are able to use the below code, but it is not necessary:

    // 'slider_id_for_post' is meta_key that used to save meta
    $gallery_id = get_post_meta( $post_id, 'slider_id_for_post', true );
    <?php masterslider( $gallery_id ); ?>

    Please let me know the result.

    Best,
    Averta

    Thread Starter marv2

    (@marv2)

    Still doesn’t work….

    Plugin Contributor averta support

    (@averta_support)

    Hi again,

    Could you please provide us with the related section? I mean the section which you used to save post meta and the section for showing slider.

    I am looking forward to hearing from you.

    Best,
    Averta

    Hello,

    I also keep getting the same error:

    “Invalid slider id. Master Slider ID must be a valid number.”

    I’ve used master slider on other of my websites and all was fine. Just on this one I keep getting this error but everything is okay. I looks like it’s a common bug but I have not been able to get fix. I love this plugin and I would like to have it on my new site too.

    Help?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to load a slider using a post meta field’ is closed to new replies.