• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Genesis devs: Need help with genesis_get_option()

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Genesis devs: Need help with genesis_get_option()

This topic is: not resolved

Tagged: genesis_get_option

  • This topic has 1 reply, 1 voice, and was last updated 12 years, 5 months ago by blogjunkie.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • January 16, 2013 at 7:37 pm #12508
    blogjunkie
    Participant

    Hi! I need some help with a plugin I wrote. I only want the code to run on posts and pages. However it's also trying to run on Premise landing pages. Because these landing pages circumvent the theme, I'm getting a Call to undefined function genesis_get_option() on the Premise pages. Here's the code:

    add_action( 'init', 'click_fbcomments_init' );
    function click_fbcomments_init() {

    if ( !is_singular() )
    return;

    // Setup Facebook JS SDK
    add_action( 'wp_head', 'click_fbcomments_jssdk_setup' );

    // Remove comments & related functions
    remove_action( 'genesis_comments', 'genesis_do_comments' );
    remove_action( 'genesis_pings', 'genesis_do_pings' );
    remove_action( 'genesis_comment_form', 'genesis_do_comment_form' );
    remove_shortcode( 'post_comments' );

    // Add Facebook comments
    add_action( 'genesis_comment_form', 'click_do_fbcomments' );

    // Replace [post_comments] shortcode with Facebook-aware one
    add_shortcode( 'post_comments', 'click_post_fbcomments_shortcode' );

    }

    Full code: https://github.com/blogjunkie/fb-comments-for-genesis/blob/master/fb-comments-for-genesis.php

    `genesis_get_option()` is called in the `click_fbcomments_jssdk_setup()` function. I tried using `if ( !is_singular() ) return` to prevent the code from running if it's not a post or page but that doesn't work.

    Appreciate any help, thanks!


    WordPress evangelist, Nike runner, Apple fanboy.
    Work: ClickWP WordPress Support, Play: adventures of a blogjunkie. Talk to me on Twitter @blogjunkie

    January 18, 2013 at 8:36 am #12849
    blogjunkie
    Participant

    Solved it thanks to @kraft! Added a `if ( !function_exists('genesis_get_options') ) return;` to the problem function


    WordPress evangelist, Nike runner, Apple fanboy.
    Work: ClickWP WordPress Support, Play: adventures of a blogjunkie. Talk to me on Twitter @blogjunkie

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble