Title: halles's Replies | WordPress.org

---

# halles

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

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

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Piecemaker 2] [Plugin: The Piecemaker 2] Display in Header and not in POST / PAGE](https://wordpress.org/support/topic/plugin-the-piecemaker-2-display-in-header-and-not-in-post-page/)
 *  [halles](https://wordpress.org/support/users/halles/)
 * (@halles)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-the-piecemaker-2-display-in-header-and-not-in-post-page/#post-1882930)
 * 40cooper i don’t really know what could be happening… i have that behaviour when
   adding flash assets (haven’t looked into it on how to fix that).
 * Have you checked if the assets are being correctly uploaded?
 * Did you add transitions to the piecemaker?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Piecemaker 2] [Plugin: The Piecemaker 2] Error When Adding Assets](https://wordpress.org/support/topic/plugin-the-piecemaker-2-error-when-adding-assets/)
 *  [halles](https://wordpress.org/support/users/halles/)
 * (@halles)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-the-piecemaker-2-error-when-adding-assets/#post-1876946)
 * I found out that the plugin tries creating directories under wp-includes which
   is plain wrong from a WP conventions point of view.
 * You have to create piecemaker-images and piecemakers (in wp-includes) and set
   permissions to 777 on those directories (not wp-includes, just the other two).
 * However, i made several modifications to the original plugin to adhere to WP 
   standards, which fixes that, moves various of the routes under uploads, and several
   other changes. If uploads directory has permissions set to 777 it will create
   the proper directories. You can find it at [http://code.halles.cl/the-piecemaker-2-for-wp-fork](http://code.halles.cl/the-piecemaker-2-for-wp-fork)
 * Cheers!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Piecemaker 2] [Plugin: The Piecemaker 2] Display in Header and not in POST / PAGE](https://wordpress.org/support/topic/plugin-the-piecemaker-2-display-in-header-and-not-in-post-page/)
 *  [halles](https://wordpress.org/support/users/halles/)
 * (@halles)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-the-piecemaker-2-display-in-header-and-not-in-post-page/#post-1882878)
 * Ok, i had it all wrong :p
 * What i did was create a function which calls the $pm instance of the PiecemakerMain
   class.
 * The function goes like this, and should be placed inside your functions.php file
 *     ```
       /**
       	 * Function to use piece maker outside post content
       	 *
       	 **/
   
       	function display_piecemaker($att = null){
       		global $pm;
   
       		if(!is_array($att)){
       			$att = array(
       				'id' => $att,
       			);
       		}
   
       		echo $pm->replaceBooks($att);
       	}
       ```
   
 * Then you would call this function from anywhere on your template like this, being
   1 the id of the desired piecemaker:
 * `display_piecemaker(1);`
    or `display_piecemaker(array('id' => 1));`
 * The second way of calling it, is because you can also pass the width and height
   as parameters (use them as array keys in the array).
 * This function **should** work on the original plugin since i’ve been fiddling
   around with it and changing a lot of stuff.
 * If it doesn’t work as is just ask and please attach the errors it may spit out
   🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Piecemaker 2] [Plugin: The Piecemaker 2] Display in Header and not in POST / PAGE](https://wordpress.org/support/topic/plugin-the-piecemaker-2-display-in-header-and-not-in-post-page/)
 *  [halles](https://wordpress.org/support/users/halles/)
 * (@halles)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-the-piecemaker-2-display-in-header-and-not-in-post-page/#post-1882847)
 * When adding it in a post, type [piecemaker id=”5″] in the editor, in the place
   you want to display it 🙂
 * the replaceBooks should be used when you want to call a Piecemaker from within
   you template code.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Piecemaker 2] [Plugin: The Piecemaker 2] Display in Header and not in POST / PAGE](https://wordpress.org/support/topic/plugin-the-piecemaker-2-display-in-header-and-not-in-post-page/)
 *  [halles](https://wordpress.org/support/users/halles/)
 * (@halles)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-the-piecemaker-2-display-in-header-and-not-in-post-page/#post-1882838)
 * You only need o pass it the piecemaker’s id. For example, if you Piecemaker has
   id 2, execute this:
 * `replaceBooks( array( 'id' => 2 ));`
 * Matías
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Piecemaker 2] [Plugin: The Piecemaker 2] Display in Header and not in POST / PAGE](https://wordpress.org/support/topic/plugin-the-piecemaker-2-display-in-header-and-not-in-post-page/)
 *  [halles](https://wordpress.org/support/users/halles/)
 * (@halles)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-the-piecemaker-2-display-in-header-and-not-in-post-page/#post-1882733)
 * You can use the function “function replaceBooks($att, $content = null){}”
 * Look at the source code (file piecemaker-main.php line 1974) to see what parameters
   you should pass to the function. You should be able to call a piecemaker anywhere
   you want just using the id like this:
 * replaceBooks(array(‘id’ => some-id));
 * Haven’t tried it yet, but i should be testing this in a couple of hours so i’ll
   get back here with the results.
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Migrate WP 3.0 from subdomain to another subdomain](https://wordpress.org/support/topic/migrate-wp-30-from-subdomain-to-another-subdomain/)
 *  [halles](https://wordpress.org/support/users/halles/)
 * (@halles)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/migrate-wp-30-from-subdomain-to-another-subdomain/#post-1616368)
 * Check your wp_blogs table and check the domain names for your blogs… it seems
   that wp looks for a “available” blog, and if not, it raises that database connection
   error 🙂
 * I had the same issue just now.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Force ONLY relative links](https://wordpress.org/support/topic/force-only-relative-links/)
 *  [halles](https://wordpress.org/support/users/halles/)
 * (@halles)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/force-only-relative-links/#post-1125851)
 * I created another solution; a plugin that will strip the protocol and hostname
   from the url, leaving just a realtive url. It won’t strip the stuff from links
   already inserted into posts or pages but new links will just be created like 
   said. You can download the stuff from here: [http://halles.cl/wp/relative-links.php.zip](http://halles.cl/wp/relative-links.php.zip)
   or [http://halles.cl/wp/relative-links.php.txt](http://halles.cl/wp/relative-links.php.txt)
 * I made it a plugin because it didn’t make a lot of sense putting into a single
   template, changing the template would break the system.
 * Hope you find it useful1!

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