Support » Plugin: AudioIgniter » Works but doesnt work for what I need

  • Resolved noodles18436

    (@noodles18436)


    The plug works when viewing from within the WP blog, but I use php code to embed my latest post into my page and your player does not display this way.
    The shortcode is correct (it works in the WP page as I mentioned)

    All I see is the post title, nothing else.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Vassilis Mastorostergios

    (@silencerius)

    Heya, when you say “you use php code to embed the latest post in a page” what do you mean exactly? Can you share some code?

    Sure, if I can actually post the code here:

    First you need to add this as first line into the .php page you’d like to embed the WP post into:

    <?
    // Include WordPress
    define(‘WP_USE_THEMES’, false);
    // Change path below to location of wp-blog-header.php on server
    require(‘./rhblog/wp-blog-header.php’);
    // Change number below to show 1 or more post excerpts
    query_posts(‘showposts=1’);

    ?>

    —- This code will then display the post where code appears —-
    <?
    while (have_posts()): the_post(); ?>
    <h4>Posted <?php the_date(); ?></h4>

    <p><?php the_title(); ?>
    <? the_content(); ?>
    <? the_tags();

    endwhile;
    ?>

    I’m seeing the title only. I’ve used this code in the past and has always worked on any of my pages. For some reason the player does not appear.

    See for yourself (news) : http://rickhorvath.com/

    Plugin Author Anastis Sourgoutsidis

    (@anastis)

    The player’s shortcode needs to work within a full page request, as there are dependent scripts and styles.
    If you need to bring a specific playlist into your homepage via code, then you can do echo do_shortcode( [ai_playlist id="123"] ); where 123 is the actual id, as reported by the plugin.

    Thanks Anastis. I tried, even replacing the double quotes, but the page fails.

    Plugin Author Anastis Sourgoutsidis

    (@anastis)

    Ugh, I’m sorry.
    It should be echo do_shortcode( '[ai_playlist id="123"]' );

    My bad.

    Thanks,

    That code did not crash the page from loading, but the player still does not display.

    I’m going to try something: Since the player works from within the blog, I’ll view source and see if I can use what I see.

    Nope, pasting source code also does not display player, must be other scripts needed.

    Plugin Author Anastis Sourgoutsidis

    (@anastis)

    Yes, the player requires scripts and styles.

    Let’s take things from the start.

    The player needs, and works, inside WordPress. What is the page you’re trying to add the player into? Isn’t it part of WordPress?

    I’m trying to embed into a php page

    Plugin Author Anastis Sourgoutsidis

    (@anastis)

    Please try the following:

    In your php page, before the </head> element, add this:
    <link rel='stylesheet' id='audioigniter-css' href='http://www.rickhorvath.com/rhblog/wp-content/plugins/audioigniter/player/build/style.css?ver=1.4.1' type='text/css' media='all' />

    Then, after the line <div id="audioigniter-1003" class="audioigniter-root" .....></div>
    add this:
    <script type='text/javascript' src='http://www.rickhorvath.com/rhblog/wp-content/plugins/audioigniter/player/build/app.js?ver=1.4.1'></script>

    Thanks, at this point that post will be updated to something new. I will keep your code on hand.

    Plugin Author Anastis Sourgoutsidis

    (@anastis)

    Alright.

    Since you’re updating, you might want to consider building your “front” page with one of the popular page builders, such as the free Elementor.
    That way, you won’t have to fiddle with PHP code and such, and you’ll effectively stay within WordPress, where everything works as intended 🙂
    If you do give Elementor a try, make sure to also install our own Elements Plus! plugin which allows you to easily embed an AudioIgniter playlist.

    Having said that, perhaps you’d like to re-evaluate the review you’ve left for the plugin? After all, the player works fine in its intended environment, and we’ve helped you resolve your issue.

    Thanks, I’m already using Mobirise since it’s quick and easy. Integrating WP is something I do only on occasion.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Works but doesnt work for what I need’ is closed to new replies.