Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. add_filter('the_title','set_page_title', 10, 2);
  2. function set_page_title($title, $id){
  3. if(in_the_loop()) {
  4.  
  5.  
  6. return 'sdfdsfdsf';
  7. }
  8. return $title;
  9. }
  10.  
  11. function bmg_company_detail_shortcode($args, $content) {
  12. global $wpdb;
  13. $table_name = $wpdb->prefix . 'bmg_company';
  14. $company_id = $_GET['id'];
  15. $output = '';
  16.  
  17. $result = $wpdb->get_results($wpdb->prepare("SELECT id,maincategoryid,name,website,yearfounded,supportpageurl,contactpage,country,about, isactive,contact_name,contact_email,contact_phone,support_phone,open_times,support_email, username, password from $table_name where id=%s", $company_id));
  18.  
  19.  
  20.  
  21. if($result) {
  22. foreach($result as $row) {
  23. set_page_title('',$row->name);
  24. $output = '
  25. <h3 class="bmg-company-title">'. $row->name .'</h3>
  26.  
  27. ';
  28. }
  29. }
  30.  
  31. return $output;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement