How to use TOC with ACF?

You can use the the acf/save_post action to copy the content from your custom ‘full_text’ field over to the normal post content field, so it can automatically be accessed by toc+ and other plugins. add_action( ‘acf/save_post’, ‘wpse199256’, 20 ); function wpse199256( $post_ID ) { global $wpdb; $post = get_post( $post_ID ); $wpdb->update( $wpdb->posts, array( ‘post_content’ … Read more

Need help for creating custom table on wordpress

I guess, you can use the following function public function pre_install() { global $wpdb; require_once(ABSPATH . ‘wp-admin/includes/upgrade.php’); $sql=” CREATE TABLE IF NOT EXISTS `”.$wpdb->prefix.”prelauncher` ( id mediumint(9) NOT NULL auto_increment, username tinytext NOT NULL, email varchar(255) NOT NULL, PRIMARY KEY (`main_id`) );”; dbDelta($sql); } and than your activation hook. register_activation_hook( __FILE__, array(‘main_class’,’pre_install’)); I dont think … Read more

Change colour of table td based on value

Here is the updated code with condition <tr> <td <?php if($total_credit >= 2): ?> style=”background-color:#000000;” <?php endif; ?>> Total: <?php echo $total_credit;?> </td> </tr> Change #000000 to appropriate color code. Then the background color will be changed. Use same logic for changing the text color.

Dynamic data table from external json feed

For the first question you could try with the following gist in the github https://gist.github.com/phpkidindia/a448e9b8132d3634bdebfa70a8d20c03 For the second option you should create a form with two fields date and distance and on the change event of those two fields you should create ajax request. and bind the result to the data table. Hope this helps.