WordPress.org

Ready to get started?Download WordPress

Forums

WP Boxer
[resolved] Possible to add to template, instead of using shortcode? (9 posts)

  1. kitelife
    Member
    Posted 1 year ago #

    Straightforward question... Is there a piece of code I can add to my theme's homepage file, rather than using only the shortcode on pages and posts?

    Love the Boxer concept, just need to be able to implement it on our widgeted home page. ;)

    http://wordpress.org/extend/plugins/boxer/

  2. Coding Our Web
    Member
    Plugin Author

    Posted 1 year ago #

    Have you tried using the Text widget? That one supports shortcodes.

    Or am I totally missing the point here ;-)

  3. kitelife
    Member
    Posted 1 year ago #

    Thanks for the reply.

    Yes, sorry - it won't work as a widget for us... We want to hardcore this into a specific, non-widgeted part of our home page.

  4. Coding Our Web
    Member
    Plugin Author

    Posted 1 year ago #

    Are we talking PHP code here?

  5. kitelife
    Member
    Posted 1 year ago #

    Ya, I would assume so.

  6. Coding Our Web
    Member
    Plugin Author

    Posted 1 year ago #

    Then you can use do_shortcode

  7. kitelife
    Member
    Posted 1 year ago #

    I created a block titled with the slug "home-page", then added this to my Main Index template...

    <?php echo do_shortcode( [wpbp_blocks set="home-page"] ) ?>

    Got this error:

    Parse error: syntax error, unexpected '[', expecting ')' in /home/user/public_html/wp-content/themes/themename/index.php on line 15

    Any suggestions? :)

  8. Coding Our Web
    Member
    Plugin Author

    Posted 1 year ago #

    Yeah, try adding quotation marks like so:

    <?php echo do_shortcode( '[wpbp_blocks set="home-page"]' ); ?>

  9. kitelife
    Member
    Posted 1 year ago #

    Bingo, that did it - thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic