Title: inserting something between  and
Last modified: August 20, 2016

---

# inserting something between and

 *  [trichnosis](https://wordpress.org/support/users/trichnosis/)
 * (@trichnosis)
 * [15 years ago](https://wordpress.org/support/topic/inserting-something-between-and/)
 * Hi;
 * I’m currently working a WP plugin. It will be as complex as buddypress. It will
   have more than one different pages
 * For example
    **Page 1** I will need to add some ajax related codes
 * **Page 2**
    I will need to add some tab related javascript codes and css files
 * **Every Page**
    All of my pages will have a different css for template issues
   and colour schemes
 * (This list can continue until page 100. I mean will need to add different things
   most of pages <head> and </head>)
 * **_I know this_**
    I know
 *     ```
       function my_custom_js() {
           echo '<script type="text/javascript" src="myjsfile.js"></script>';
       }
       // Add hook for admin <head></head>
       add_action('admin_head', 'my_custom_js');
       // Add hook for front-end <head></head>
       add_action('wp_head', 'my_custom_js');
       ```
   
 * but it’s a quite bad function to use because i will need to use this bad function
   over 50 times 🙁
 * **My Question**
 * E.g., Joomla! 1.6 has an API like below
 *  `$doc =& JFactory::getDocument();
    $doc->addCustomTag($headTag);`
 * to do that.
 * Is there any similar function for WP? or is it doing that with a WP hack?
 * Thank you for all help

The topic ‘inserting something between and’ is closed to new replies.

## Tags

 * [head](https://wordpress.org/support/topic-tag/head/)
 * [plugin-development](https://wordpress.org/support/topic-tag/plugin-development/)

 * 0 replies
 * 1 participant
 * Last reply from: [trichnosis](https://wordpress.org/support/users/trichnosis/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/inserting-something-between-and/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
