Results 1 to 1 of 1
Like Tree1Likes
  • 1 Post By spectrus

Thread: PHP shortcode option not working inside loop

  1. #1
    Thread Starter
    Expired Customer spectrus's Avatar
    Join Date
    Sep 2015
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP shortcode option not working inside loop

    Hi,

    I have the following code in my custom post template:

    PHP Code:
    if(in_the_loop()) {
        
    error_log('we are in loop');
    } else {
        
    error_log('we are not in loop');
    }
    echo 
    do_shortcode'[starstruck_shc]' ); 
    The only HTML appearing in the page is the following empty div:

    PHP Code:
    <div class="starstruck-ptype" style=""></div
    It works fine if the only option checked is appropriate post type, but I don't want it at the end of the content. I tried various combinations of settings (custom post checked with 'use shortcode' checked and unchcked, with various taxonomy options checked and unchecked). What am I doing wrong?
    luckydad likes this.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Star rating PHP Shortcode but not working.
    By sreenubfa in forum StarStruck
    Replies: 0
    Last Post: March 12th, 2015, 08:39 PM
  2. [SOLVED] Shortcode not working
    By tbase in forum Shortys for Vantage
    Replies: 1
    Last Post: July 29th, 2014, 05:16 AM
  3. Map Zoom not working in shortcode
    By rapidweb in forum Mapsupreme
    Replies: 8
    Last Post: January 28th, 2014, 11:43 AM
  4. Map working with php but not with shortcode
    By allthedeals in forum Mapsupreme
    Replies: 2
    Last Post: January 16th, 2013, 10:55 PM
  5. Have 2 Blogs working inside Classipress
    By prowireless in forum Help Using ClassiPress
    Replies: 3
    Last Post: August 14th, 2011, 08:30 AM