Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6987315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:55:15+00:00 2026-05-27T18:55:15+00:00

I am using developing a child theme for Woothemes’ Canvas. I am trying to

  • 0

I am using developing a child theme for Woothemes’ Canvas.

I am trying to use functions.php in the child theme to only use actions on my custom post type.

This code doesn’t seem to be working:

 add_action( 'woo_post_inside_after', 'my_geo_mashup' );
function my_geo_mashup() {
       echo GeoMashup::map();
    if ($post->post_type == 'listings') {
        //My function
       }
}

add_action( 'woo_post_inside_before', 'listings_nivo' );
function listings_nivo() {
echo do_shortcode('[nivo source="current-post" ]');
 if ($post->post_type == 'listings') {
        //My function
       }
}

So, I’m unsure how to get the above to work properly and only show these items on the custom post type, or only for the custom post type template single-listings.php (as I only want the map and slider to show on the actual post, not on the blog page (archive.php)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:55:16+00:00Added an answer on May 27, 2026 at 6:55 pm

    Rather than making the entire $post object global, you can just make $post_type global instead. Ex below.

    I’m not exactly sure where that function is being loaded, but make sure you hook somewhere within the post. If the action is before, as far as I know and from experience, the post variable will be null.

    Just as a test, try running the action in wp_footer Ex. add_action( ‘wp_footer’, ‘listings_nivo’ );
    See if that yeilds any results.

    if echoing var_dump($post) is still null, well, not sure where to go from there.

    So you can try running the below, then run the action in the appropriate place if it works:

    function listings_nivo() {
        echo do_shortcode('[nivo source="current-post" ]');
        global $post_type;
            // Diagnostic purposes
        echo var_dump($post_type);
        if ($post_type == 'listings') {
                //My function
        }
    }
    add_action( 'wp_footer', 'listings_nivo' );
    

    Check your error log or turn wp_debug to true in your wp-config.php file if nothing else to see if anything else is going on.

    Best of luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get started developing using the .NET Micro Framework but appear
I am currently developing a custom WordPress theme and ran into a problem. I
Till now, I was using VB for developing applications. Now I have to use
I am developing using TDD and ASP.Net MVC. I have a custom ActionFilterAttribute which
I am developing an app in which i am using custom list tab,By using
I'm developing using the Facebook PHP SDK. I wanted to make it so that
I'm developing using JDE 4.5 which doesn't contain the PERMISSION_RECORDING, and it's denied by
I am developing using 3.0 and VS 2008. The problem is my build server
I've got two applications I'm developing using Qt on windows. I want the user
I enjoy developing algorithms using the STL, however, I have this recurring problem where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.