Title: aargambit's Replies | WordPress.org

---

# aargambit

  [  ](https://wordpress.org/support/users/aargambit/)

 *   [Profile](https://wordpress.org/support/users/aargambit/)
 *   [Topics Started](https://wordpress.org/support/users/aargambit/topics/)
 *   [Replies Created](https://wordpress.org/support/users/aargambit/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/aargambit/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/aargambit/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/aargambit/engagements/)
 *   [Favorites](https://wordpress.org/support/users/aargambit/favorites/)

 Search replies:

## Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Hueman] No videos and video link section in edit panel after update](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/)
 *  Thread Starter [aargambit](https://wordpress.org/support/users/aargambit/)
 * (@aargambit)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/#post-5834029)
 * This means that there are two versions now.
 * 1. Compatible with old versions but not with wordpress restrictions as it prevents
   using other themes without loosing some content. It can be downloaded here and
   must be updated manually each time.
    [http://alxmedia.se/themes/hueman/](http://alxmedia.se/themes/hueman/)
 * 2. WordPress version which causes loosing some content as in case of other wordpress
   themes so you must copy meta fields content to main post/page content either 
   manually or with some script based on sugesstions i left above your post
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Hueman] No videos and video link section in edit panel after update](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/)
 *  Thread Starter [aargambit](https://wordpress.org/support/users/aargambit/)
 * (@aargambit)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/#post-5834019)
 * Ok, done. I wrote a script which safely copied all video URL and placed them 
   in post content as embeds. I cant place here whole code as it contains some company
   data i work for but least i can do is share some key parts of it.
 * video URLs are stored in your_wp_prefix_postmeta table in rows meta_value where
   row meta_key is _video_url. To be sure i joined posts table and filtered those
   which are posts and are published (wordpress tables are such a mess …).
 * first query
    `'SELECT ID,meta_value FROM your_wp_prefix_posts INNER JOIN your_wp_prefix_postmeta
   ON your_wp_prefix_posts.ID=your_wp_prefix_postmeta.post_id WHERE your_wp_prefix_posts.
   post_status="publish" AND your_wp_prefix_posts.post_type="post" AND your_wp_prefix_postmeta.
   meta_key="_video_url" ORDER BY ID'`
 * I striped URLs from meta_values to bare code ([https://www.youtube.com/watch?v=CODE](https://www.youtube.com/watch?v=CODE)
   => CODE) taking off any additional url parameters and timestamps placed there
   by mistake and used this CODE to make proper embed code like this
 * `<iframe width=\"720\" height=\"405\" src=\"https://www.youtube.com/embed/'.$
   CODE.'?feature=oembed\" frameborder=\"0\" allowfullscreen></iframe>`
 * In the same loop i used IDs and those generated CODES to build one single query(
   didnt want to make many update calls to database) using very simple MySQL syntax.
 *     ```
       UPDATE your_wp_prefix_posts SET post_content = CASE ID SET
       WHEN '1' THEN 'meta_value_1'
       WHEN '2' THEN 'meta_value_2'
       WHEN '3' THEN 'meta_value_3'
       ...
       ELSE field_name
       END
       ```
   
 * And it worked. Had double videos now, one from meta fields and one from post 
   content itself. Updated theme and first one dissapeared.
 * PS. Little advice: before applying the code make some counting of rows you have
   from first query with mysqli_num_rows() function or other and compare them with
   actual posts number on your site. Just to be sure that you get proper data.
 * PS2. Well,ive just noticed that the downside of this operation is that my embeds
   have fixed width and height and thus they are cropped when are played on small
   screens. Must to tix that issue too.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Hueman] No videos and video link section in edit panel after update](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/)
 *  Thread Starter [aargambit](https://wordpress.org/support/users/aargambit/)
 * (@aargambit)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/#post-5833964)
 * Well i must admit that at first i was very optimistic about this nonwordpres 
   version. But i followed links you showed in previous posts and i found that WordPress
   team explanation is somewhat reasonable. Indeed binding site content with theme
   which causes content complete dependency on the theme isnt good idea in longer
   run. I’ll try to dig some in database and find where exactly those embed codes
   are stored. Then ill try to write a script that creates normal embeds from those
   links for every article. At least this is some idea, dont know if its possible.
   If not then ill have make it manually (cry).
 * Offcourse it doesnt mean ill drop hueman, no. Just will stick with repository
   version as its more safe to me.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Hueman] No videos and video link section in edit panel after update](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/)
 *  Thread Starter [aargambit](https://wordpress.org/support/users/aargambit/)
 * (@aargambit)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/#post-5833942)
 * But would this version be constantly updated in the future? This is main thing
   im concerned about it.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Hueman] No videos and video link section in edit panel after update](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/)
 *  Thread Starter [aargambit](https://wordpress.org/support/users/aargambit/)
 * (@aargambit)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/#post-5833914)
 * Im looking now at page html structure. Is it possible to only delete custom meta
   fields in newest version and for the compatibility sake keep <div clas=video-
   container> element? Old posts would still contain videos and new posts could 
   be published in new wany as this element would be empty anyway. Is it possible?
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Hueman] No videos and video link section in edit panel after update](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/)
 *  Thread Starter [aargambit](https://wordpress.org/support/users/aargambit/)
 * (@aargambit)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/#post-5833913)
 * > Your other option is to edit the theme video posts and simply put the video
   > link at the top of the post, in the main text field – and it will be included.
 * OMG! I have above 470 videos (cry) …
 * But maybe there is some way to use this deprecated field to add it in post template
   php file? Im using child theme.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Hueman] No videos and video link section in edit panel after update](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/)
 *  Thread Starter [aargambit](https://wordpress.org/support/users/aargambit/)
 * (@aargambit)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/no-videos-and-video-link-section-in-edit-panel-after-update/#post-5833904)
 * Downgrade to previous veriosn worked. However If theme database entries has been
   also changed with version 1.5.3 then i have mess now as i downgraded only files.
 * So waiting for official solution.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Permalinks "postname" -> posts and child pages OK, normal pages give 404](https://wordpress.org/support/topic/permalinks-postname-posts-and-child-pages-ok-normal-pages-give-404/)
 *  Thread Starter [aargambit](https://wordpress.org/support/users/aargambit/)
 * (@aargambit)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/permalinks-postname-posts-and-child-pages-ok-normal-pages-give-404/#post-5798942)
 * Polylang plugin caused problem. Topic closed.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Permalinks "postname" -> posts and child pages OK, normal pages give 404](https://wordpress.org/support/topic/permalinks-postname-posts-and-child-pages-ok-normal-pages-give-404/)
 *  Thread Starter [aargambit](https://wordpress.org/support/users/aargambit/)
 * (@aargambit)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/permalinks-postname-posts-and-child-pages-ok-normal-pages-give-404/#post-5798710)
 * Two more things that may be helpfull
    1. Im using multisite mode of wordpress(
   archidiecezja, niezaleznylublin, samorzad.tv) 2. On samorzad.tv site im using
   the same theme with postname permalinks. And offcourse everything is ok.
 * And here is better link for screen provided before.
    [http://postimg.org/image/woxrm5iwn/](http://postimg.org/image/woxrm5iwn/)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [RSS shortcode doesnt work](https://wordpress.org/support/topic/rss-shortcode-doesnt-work/)
 *  Thread Starter [aargambit](https://wordpress.org/support/users/aargambit/)
 * (@aargambit)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/rss-shortcode-doesnt-work/#post-5700629)
 * Well i didnt mention it but i thought its pretty much obvious. Offcourse when
   i was writing about php hacking i ment functions.php in child theme. I never 
   touch core files neither of wordpres core nor plugins or themes. I always use
   child themes and even if some stubborn plugin stylesheets have !important tag
   with all their styles im unregistering whole style – not replace it physicaly
   like many users do .
 * As for plugins its VERY easy to overload wordpress with bunch of “onetask” plugs
   and im trying to avoid this by installing only those more complicated and demanding
   ones. Thats why i chose to install rss with tabs plugins instead of simple shortcode
   plugin.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [RSS shortcode doesnt work](https://wordpress.org/support/topic/rss-shortcode-doesnt-work/)
 *  Thread Starter [aargambit](https://wordpress.org/support/users/aargambit/)
 * (@aargambit)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/rss-shortcode-doesnt-work/#post-5700587)
 * Well i thought its a matter of some simple php hack, because shortcodes arent
   difficult to implement. Im using child theme and I wanted to avoid using plugin.
   But if its necessary then ill rather use ready sliding plugin.
 * Anyway, thanks for help.
 * I’ll leave this topic open, maybe someone wil give some simple php solution for
   this.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [RSS shortcode doesnt work](https://wordpress.org/support/topic/rss-shortcode-doesnt-work/)
 *  Thread Starter [aargambit](https://wordpress.org/support/users/aargambit/)
 * (@aargambit)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/rss-shortcode-doesnt-work/#post-5700539)
 * `That's a WordPress.com support document, an entirely separate entity from WordPress.
   org.`
 * Wow, thats … confusing. When i was login in i was confused by wordpress panel
   at that site. Login and password was the same so i thought its some kind of new
   forum management system. Even searching for this forum through google, through
   my native language forum and skipping wordpress.com forums wasnt easy and obvious.
 * As for the answer. I dont need RSS wigdet. I need RSS shortcode to use RSS’s 
   in particular widget (slider).
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Show data in post from some remote database – solution? plugin?](https://wordpress.org/support/topic/show-data-in-post-from-some-remote-database-solution-plugin/)
 *  Thread Starter [aargambit](https://wordpress.org/support/users/aargambit/)
 * (@aargambit)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/show-data-in-post-from-some-remote-database-solution-plugin/#post-5106880)
 * Ok i found some track (it was hard to make proper sentece for uncle google) here…
 * [http://wordpress.stackexchange.com/questions/1604/using-wpdb-to-connect-to-a-separate-database](http://wordpress.stackexchange.com/questions/1604/using-wpdb-to-connect-to-a-separate-database)
 * I’ll quote correct answer in case link will die.
 * > Yes it’s possible.
   > The wpdb object can be used to access any database and query any table. Absolutely
   > no need to be WordPress related, which is very interesting.
   > The benefit is the ability to use all the wpdb classes and functions like get_results,
   > etc so that there’s no need to re-invent the wheel.
   > Here’s how:
   >     ```
   >     $mydb = new wpdb('username','password','database','localhost');
   >     $rows = $mydb->get_results("select Name from my_table");
   >     echo "<ul>";
   >     foreach ($rows as $obj) :
   >        echo "<li>".$obj->Name."</li>";
   >     endforeach;
   >     echo "</ul>";
   >     ```
   > 
 * This is how to connect with second database. I will change it a little bit to
   my needs and put it to functions.php in child theme. In second step ill probably
   use Shortcode API
 * [http://codex.wordpress.org/Shortcode_API](http://codex.wordpress.org/Shortcode_API)
 * This way ill create a shortcode which ill use in specific post.
 * If my idea is wrong then please correct me here, i wont mark this topic as resolved
   untill i fully get my task done.

Viewing 13 replies - 1 through 13 (of 13 total)