Carrying information from button click into form [closed]

The better way to do this is using javascript/jquery. Use either javascript webstorage api or jquery ajax $.post. Webstorage api will be good for this. Here how you can do it. $(‘body’).on(‘click’, ‘.button.small’, function(){ var index = $(this).parents(‘table’).index(‘table’); var cur_workshop = $(this).parents(‘.innercontent’).find(‘h3’).eq(index).text(); localStorage.setItem(‘workshop’, cur_workshop); }); Place above script on http://yft.ac/upcoming-workshops/ this page template. Then call … Read more

Database custom table issues – incorrect result displayed

Not sure why you’re getting a WSOD, but immediately I can see that in the following: $selectedSchoolName = $wpdb->get_results( “SELECT Name FROM tblYBSSchool WHERE SchoolID=”.$SelectedSchoolID ); // get selected location name $selectedLocationName = $wpdb->get_results( “SELECT Name FROM tblYBSLocality WHERE LocalityID=”.$SelectedLocationID ); // get route ID $getRouteID = $wpdb->get_results( “SELECT * FROM tblYBSRoute WHERE RouteID IN … Read more

Display single post inside accordion based on form submission results

Closing off as the issue is resolved. For anyone interested, the result is as follows (refer to the code detailed above for the initial DB-table connections, as the code below refers to the output only): if (isset($SelectedLocationID) && isset($SelectedSchoolID)) { ?> <div id=”resultsDiv”> <div id=”resultsHead”> <h3>Search results for routes between:</h3> <b><?php echo $selectedLocationName; ?></b> and … Read more

Search Query that Includes Custom Table

I managed to solve this by taking s_ha_dum’s suggestion to use a UNION. It is as follows: (SELECT ID, post_status, post_title, post_excerpt, post_content FROM wp_posts WHERE ((`post_title` LIKE ‘%diamond%’) OR (`post_excerpt` LIKE ‘%diamond%’) OR (`post_content` LIKE ‘%diamond%’)) AND (`post_status` = ‘publish’ )) UNION (SELECT ref, StoreID, Article, subarticle, description FROM wp_hwproducts WHERE (`article` LIKE ‘%diamond%’) … Read more

Insert double entry in DB

Simple – if you do not want duplicate information then before you insert anything check if such data is already present. Just query for it and see if there is a match. From WP perspective however, you seem to be looking at technique (database table) that you will rarely need in practice. WordPress offers wealth … Read more

Add pagination to table generated by wp_query

As already pointed out in comments gb_bypass_filter is not a valid parameter for WP_Query. If you want to suppress to effect of filters on your query, add ‘suppress_filters’ => true to your query arguments previous_posts_link() does not accept two arguments, only one. Unlike next_posts_link(), it does not have the second $max_pages parameter. So you can … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)