I have created a pretty simple shortcode that contains html and php and wrapped it between the following code and used the shortcode inside a WordPress post. I went ahead to create custom plugin for which contains the shortcode.
I am having a challenge whereby the Yoast plugin is unable to detect the content of the shortcode. I know the shortcode is working perfectly, it's just that Yoast won't pull the right word count. The shortcode really contains a basic select query that fetches data from the database.
I found an article that mentioned Yoast only detects content that goes into the default WordPress editor and may not detect content from themes and plugins unless the developer adds the functionality. I'm the one doing this even as I learn.
The shortcode template I'm using:
function test_shortcode() {
ob_start();
....
return ob_get_clean();
}
add_shortcode( 'myshortcd', 'test_shortcode' );
Is there some code I need to add to the basic shortcode to get this to work?
Thanks.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…