Cornerstone and PHP

Hello,

i try to do an query with Wordpress DB > via PHP Code

[insert_php]
<?php
$user_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wb1_users" );
echo "<p>User count is {$user_count}</p>";
?>
[/insert_php]

We have already an other WP Site, there is the code Working fine - but it is not the same theme.

Thanks for your help

Hey @hmurauer,

Regretfully, we could not support issues with third-party plugins and custom code. I quickly searched for the usage of Insert PHP shortcode / plugin and it looks like you’re not using the correct setup. Please contact the plugin author or search the plugin’s documentation for more setup requirements and plugin support.

Thank you for understanding.

Hi Christian,

hold on…

Theme X is from you!
The Cornerstone is also from X!

All 2gether from Themeco!

I can’t see a thirt-Party issue! my question was only, how i can insert a PHP code - that the WP is also showing the request from db?..

Kind regards

Hello @hmurauer,

Sorry for the confusion. Please understand that this code:

[insert_php]
<?php
$user_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wb1_users" );
echo "<p>User count is {$user_count}</p>";
?>
[/insert_php]

is a 3rd party shortcode code that is not supported by the theme. You will need 3rd party plugin to run php within the content area. Perhaps any of this plugins could help you:

Thank you for your understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.