Title: aamche's Replies | WordPress.org

---

# aamche

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

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

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Bootstrap Shortcodes for WordPress] Nesting columns](https://wordpress.org/support/topic/nesting-columns-2/)
 *  [aamche](https://wordpress.org/support/users/aamche/)
 * (@aamche)
 * [10 years ago](https://wordpress.org/support/topic/nesting-columns-2/#post-6677931)
 * There are good reasons why shortcode nesting doesn’t work. But it does make the
   job harder when nesting. I managed with a little help from Google to use the 
   below code, which will allow you to nest one column set.
 * This is how nested shortcodes are suggested to work. Notice the row-b and column-
   b
 *     ```
       [row]
       [column sm="6"]
   
       start of col 1
   
       [row-b]
       [column-b sm="6"]
   
       sub col 1
   
       [/column-b]
       [column-b sm="6"]
   
       sub col 2
   
       [/column-b]
       [/row-b]
   
       end of col 1
   
       [/column]
       [column sm="6"]
   
       col 2
   
       [/column]
       [/row]
       ```
   
 * Functions to add to your functions.php. Essentially it extracts the shortcode
   and re-wraps it.
 *     ```
       add_shortcode('column-b', 'col_cb');
       add_shortcode('row-b', 'row_cb');
   
       function col_cb( $atts, $content ) {
       	$attr = array();
       	foreach($atts as $key=>$att){
       		$attr[] = ' ' . $key . '="' . $att . '"';
       	}
       	$content = do_shortcode('[column' . implode('', $attr) . ']' . $content . '[/column]');
       	return $content;
       }
   
       function row_cb( $atts, $content ) {
       	$attr = array();
       	foreach($atts as $key=>$att){
       		$attr[] = $key . '="' . $att . '"';
       	}
       	$content = do_shortcode('[row' . implode('', $attr) . ']' . $content . '[/row]');
       	return $content;
       }
       ```
   
 * You could nest deeper by just adding.
 *     ```
       add_shortcode('column-c', 'col_cb');
       add_shortcode('row-c', 'row_cb');
       add_shortcode('column-d', 'col_cb');
       add_shortcode('row-d', 'row_cb');
       ```
   
 * Orginal post (This helped me)
    [http://wordpress.stackexchange.com/questions/125328/how-to-parse-nested-shortcodes](http://wordpress.stackexchange.com/questions/125328/how-to-parse-nested-shortcodes)
 * Once again thanks to the plugin maker, this is a great plugin I use in all my
   sites.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Easy Site Importer] Running Easy Site Importer Under Vagrant](https://wordpress.org/support/topic/running-easy-site-importer-under-vagrant/)
 *  [aamche](https://wordpress.org/support/users/aamche/)
 * (@aamche)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/running-easy-site-importer-under-vagrant/#post-6574565)
 * Thanks got it working, but I changed it a little bit to use the wp-content folder.
 * file: classes/class-spider.php
    line: 446 (approx)
 * change
 *     ```
       file_put_contents('.head.htm',$head_HTML);
       ```
   
 * to
 *     ```
       $upload_dir = wp_upload_dir();
       $this->upload_dir = $upload_dir['basedir'] . '/easy-site-importer/';
       if(!file_exists($this->upload_dir)){
       	mkdir($this->upload_dir, 0777);
       }
       file_put_contents($this->upload_dir . 'head.htm',$head_HTML);
       ```
   
 * And then (about line 497)
 *     ```
       $this->meta[$page]=array_merge(array('Title' => $title[1], 'Scrape' => $scrape, 'Filter' => $actual_HTML, 'Formatted' => $this->proc_HTML, 'Images' => $this->images_copy),get_meta_tags('.head.htm'));
       ```
   
 * to
 *     ```
       $this->meta[$page]=array_merge(array('Title' => $title[1], 'Scrape' => $scrape, 'Filter' => $actual_HTML, 'Formatted' => $this->proc_HTML, 'Images' => $this->images_copy),get_meta_tags($this->upload_dir . 'head.htm'));
       ```
   

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