Submitting my form to the database and then redirecting to payment site

Good afternoon, I managed to sort this out. I have amended my functions.php to the following. function mcPaySubmit(){ global $wpdb; include(‘paygate.php’); $last = wp_get_recent_posts(array(‘numberposts’ => ‘1’, ‘post_type’ => ‘post’, ‘post_status’ => ‘pending’, ‘author’ => $user_id)); $purchase_post_id = $last[‘0’][‘ID’]; $purchase_days = $_POST[‘dext’]; $purchase_date = $_POST[‘mcTransactionDate’]; $purchase_amount = $_POST[‘totalDue’]; if($wpdb->insert(‘ac_purchases’, array( ‘purchase_post_id’ => $purchase_post_id, ‘purchase_days’ => $purchase_days, … Read more

Filtered table in wordpress

Ok I got my answer if($char) { $results = $wpdb->get_results( “SELECT * FROM teacher_directory where Name LIKE ‘$char%'”, ARRAY_A ); if(!empty($results)) { //Printing the table here } }

Renaming “Expand Details” within “Add Media”

It’s possible to change the output of the label with jQuery but I’m not sure the best hook to do this besides admin_footer. // Collapse var $open = jQuery(‘.acf-expand-details > .is-open’), $open_icon = $open.find(‘span’); $open.html(‘MIN Details –>’); $open.prepend($open_icon); // Expand var $close = jQuery(‘.acf-expand-details > .is-closed’), $close_icon = $close.find(‘span’); $close.html(‘<– MAX Details’); $close.prepend($close_icon); add_action( ‘admin_enqueue_scripts’, … Read more

Passing different content to template parts

1. Simply call the template part in each place. <?php get_template_part(‘content’,’left’); ?> and <?php get_template_part(‘content’,’right’); ?> You would then create content-left.php and content-right.php templates. 2. A different approach would be to call do_action there instead. eg. <?php do_action(‘template_content_left’); ?> This could give you an extra level of control over the content template used. eg. in … Read more

Add a downloaded JS file to WordPress

You have to load your javascript Snippet inside your header. You’ll have to options: Edit your themes header.php and put the code before the closing tag Insert your code into the header with a custom function inside your functions.php function my_custom_js() { echo ‘<script type=”text/javascript”> jQuery(document).ready(function($){ jQuery(“#double-scroll”).doubleScroll(); }); </script>’; } // Add hook for front-end … Read more