• Resolved loggins

    (@loggins)


    WE have a feature which exports to a PDF file and would like to be able to randomize the ads used within AdvancedAds within the PDF. Is there code available to use to make this possible with the plugin?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Thomas Maier

    (@webzunft)

    Hi loggins,

    thanks for that interesting question.

    It is possible that placements don’t work here due to some constrictions.

    If shortcodes work in your files then you could try placing a group shortcode into the content and test with that.

    Please let me know if this works or maybe a bit more about the technology behind it so that I can come up with a bit more.

    Thanks,
    Thomas

    Plugin Author Thomas Maier

    (@webzunft)

    Hi @loggins,

    have you been able to make it work or is there still something I could help you with?

    Best regards,
    Thomas

    Thread Starter loggins

    (@loggins)

    Unfortunately, we have not been able to figure out the code to be able to pull in ads from Advanced Ads into MPDF.

    Plugin Author Thomas Maier

    (@webzunft)

    Thanks for your feedback.

    If default shortcodes from WordPress won’t work here either then I fear there is nothing I can help with.

    Best regards,
    Thomas

    Thread Starter loggins

    (@loggins)

    Let me clarify what we are trying to accomplish. We use MPDF script (located on a different domain) from our theme template using Advanced Ads. We are wanting to pull in the separate ad groups into our MPDF script, however i cannot seem to locate a direct code string (or link) which can called by MPDF where to pull the ads from (i.e. Ad Group ID: 8114) in our theme template.

    Thread Starter loggins

    (@loggins)

    I have created a layout in wordpress with an Advanced Ad group here https://newmusicweekly.com/tbuilder-layout/ac-ad/ however, in order for MPDF to recognize the image Advanced Ad would need to propagate an image, image tag, or something for it to be imported for MPDF use. Is this possible rather than just pointing to the “group” folder “ac-ad”?

    Plugin Author Thomas Maier

    (@webzunft)

    Hi loggins,

    thanks for the details.

    You can load the content of an ad group using something like this:

    $adgroup = new Advanced_Ads_Group( $group_id, $args );
    $ordered_ad_ids = $adgroup->get_ordered_ad_ids();
    echo $adgroup->output( $ordered_ad_ids );

    By default, it should return you the HTML of a single ad.

    You can find the code of that class in advanced-ads/classes/ad_group.php.

    Does that help?

    Best regards,
    Thomas

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Randomize ads in PDF export?’ is closed to new replies.