How to check if a value exists in one of two database tables

You had not very good architecture for your application. Best way is in save user information in one table and use separated fields or linked table for save extra information. In your case you case use UNION and check tables in one query. And correct way is use SELECT COUNT(*) and check result instead SELECT … Read more

ajax form function error

This error is telling you that there was a 500 error in the PHP of your AJAX callback: jquery.js:8625 POST /admin-ajax.php 500 () This would be caused by a syntax error or other coding mistake. In looking at your code one obvious major problem is here: // use \Aws\Polly\PollyClient; // this was moved to before … Read more

ACF: Hide a div or template section when a custom field (in a field group) is empty

Hope this help how to figure out your request <?php $werdegang = ‘werdegang’; // werdegang parent group $station1 = ‘jahr_station_1’; // ‘ child group 1 $station2 = ‘jahr_station_2’; // ‘child group 2 $station3 = ‘jahr_station_3’; // ‘child group 3 $station1Jahr=”jahr1″; $station2Jahr=”jahr2″; $station3Jahr=”jahr3″; $station1Title=”jahr1_Title”; $station1Text=”jahr1_Text”; $station2Title=”jahr2_Title”; $station2Text=”jahr2_Text”; $station3Title=”jahr3_Title”; $station3Text=”jahr3_Text”; ?> <?php if( (!empty($station1Title) && !empty($station1Text)) && … Read more

WordPress: paginating array using a foreach

I ended up using this method… http://www.lotsofcode.com/php/php-array-pagination.htm This script will allow you to take an array and paginate across multiple pages. Works good for what i need. Just working on how to number each item in the array across the pages in a descending order…

Getting Post Permalink Outside of Loop Not Working

According to: http://wpseek.com/get_comment_count/ $single is the post ID. Try: public function get_comment_count($single){ if (isset($this->params[‘comments’]) && $this->params[‘comments’] == ‘yes’){ return ‘<div id=”disquscomments”><a href=”‘.get_permalink($single).’#disqus_thread”>Comments</a></div>’; } else { return null; } }