0

I'm running some code through phpStorm and am getting an error:

Method 'post_title' not found in class. 

at this line:

echo $post->post_title();

Is that phpStorm getting things wrong or am I accessing post_title incorrectly?

1
  • Can you provide more information? How do you get the $post object?
    – cybmeta
    Apr 20, 2015 at 18:50

1 Answer 1

0

Two lines of code could hide many things but I find an error: post_title is an attribute and not a method.

echo $post->post_title;

Reference: https://codex.wordpress.org/Class_Reference/WP_Post

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.