Title: big_s's Replies | WordPress.org

---

# big_s

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

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

 Search replies:

## Forum Replies Created

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

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Change Permalink of Single Post to Original](https://wordpress.org/support/topic/change-permalink-of-single-post-to-original/)
 *  Thread Starter [big_s](https://wordpress.org/support/users/big_s/)
 * (@big_s)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/change-permalink-of-single-post-to-original/#post-5000976)
 * Hi jayseae,
 * Some manual queries on the back end identified and solved the issue. The problem
   was that another page with the same slug had been created however this page was
   also flagged as the landing page in settings. The permalink of this page was 
   therefore automatically changed by WP to only the domain rather than domain +
   page slug based permalink so wasn’t obvious in wp-admin.
 * Thanks anyway.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Change Permalink of Single Post to Original](https://wordpress.org/support/topic/change-permalink-of-single-post-to-original/)
 *  Thread Starter [big_s](https://wordpress.org/support/users/big_s/)
 * (@big_s)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/change-permalink-of-single-post-to-original/#post-5000955)
 * Hi, thanks for taking time to look at this.
 * Definitely running 3.9.1. Programming solutions are fine but just an unexpected
   necessity. This seems such a trivially simple thing to want to do. I am surprised
   the WP database doesn’t get tidied up enough after a page has been deleted so
   that you are able to create a new page with the same permalink after.
 * Sure I could start running queries on the DB but surely a plugin like WP Optimize
   or WP Clean Up should remove any extraneous posts and associated meta for me.
   Do I really have to get my hands that dirty to solve this? – I have 150+ sites
   to do this on and so the more complex the solution the more of a real pain this
   becomes.
 * Any other ideas?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Change from GET to permalink style URL](https://wordpress.org/support/topic/change-from-get-to-permalink-style-url/)
 *  Thread Starter [big_s](https://wordpress.org/support/users/big_s/)
 * (@big_s)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/change-from-get-to-permalink-style-url/#post-4475162)
 * Seems the solution involves adding a rewrite rule within wordpress. I have tried
   the following but alas it doesnt work:
 *     ```
       add_action( 'init', 'product_gallery_rewrite_rule' );
       function product_gallery_rewrite_rule () {
       	add_rewrite_rule( '^gallery/([^/]*)/?', 'gallery.php?pslug=$matches[1]', 'top' );
       }
       ```
   
 * Anyone any ideas why this isnt working? I havent explicitly flushed the rewrite
   rules but have visited the permalinks page a few times and cleared caches etc.
 * Thanks.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [infolinks injection – site hacked](https://wordpress.org/support/topic/infolinks-injection-site-hacked/)
 *  Thread Starter [big_s](https://wordpress.org/support/users/big_s/)
 * (@big_s)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infolinks-injection-site-hacked/#post-3897279)
 * Sure, these are all due diligence activites that we have already conducted. I
   was hoping that someone may have experienced the same problem and is able to 
   shed light on how to stop it as all our efforts have so far failed.
 * Thanks.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [infolinks injection – site hacked](https://wordpress.org/support/topic/infolinks-injection-site-hacked/)
 *  Thread Starter [big_s](https://wordpress.org/support/users/big_s/)
 * (@big_s)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infolinks-injection-site-hacked/#post-3897278)
 * Sure, these are all due diligence activites that we have already conducted. I
   was hoping that someone may have experienced the same problem and is able to 
   shed light on how to stop it as all our efforts have so far failed.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [infolinks injection – site hacked](https://wordpress.org/support/topic/infolinks-injection-site-hacked/)
 *  Thread Starter [big_s](https://wordpress.org/support/users/big_s/)
 * (@big_s)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/infolinks-injection-site-hacked/#post-3897277)
 * Sure, these are all due diligence kind of activities but I was hoping that someone
   may have specific experience with the same problem and found a way to prevent
   it as all our efforts along the lines noted so far have failed.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Using wpdb->wp_query with wp_remote_post](https://wordpress.org/support/topic/using-wpdb-wp_query-with-wp_remote_post/)
 *  Thread Starter [big_s](https://wordpress.org/support/users/big_s/)
 * (@big_s)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/using-wpdb-wp_query-with-wp_remote_post/#post-3835178)
 * Haha thanks Rajesh, such a simple things I couldn’t see it!
 * Nice one 🙂
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Programmatic Activation Of Theme Not Working](https://wordpress.org/support/topic/programmatic-activation-of-theme-not-working/)
 *  Thread Starter [big_s](https://wordpress.org/support/users/big_s/)
 * (@big_s)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/programmatic-activation-of-theme-not-working/#post-3564419)
 * Hi,
 * Anyone got any ideas on this? Just need to know how and where to call this function
   solostream_option_setup() above. Can I append it to a file somewhere and then
   remove after function has been called or can I write a separate php file to call
   it or…
 * Thanks,
 * big_s.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Programmatic Activation Of Theme Not Working](https://wordpress.org/support/topic/programmatic-activation-of-theme-not-working/)
 *  Thread Starter [big_s](https://wordpress.org/support/users/big_s/)
 * (@big_s)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/programmatic-activation-of-theme-not-working/#post-3564411)
 * Hi,
 * Thanks for the reply. I am actually a noob to wordpress core and functions so
   any advice is welcome.
 * After some more rooting around based on your tips I found the following in a 
   file called theme-settings.php (obvious really!) that is included as
    `require_once(
   TEMPLATEPATH . "/theme-settings.php");` within functions.php of the new theme:
 *     ```
       <?php
       // Add default settings and show Theme Settings page after activation
       /*-----------------------------------------------------------------------------------*/
   
       if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) {
       	add_action('admin_head','solostream_option_setup');
       	header( 'Location: '.admin_url().'themes.php?page=theme-settings.php' );
       }
   
       function solostream_option_setup(){
   
       	//Update EMPTY options
       	$solostream_array = array();
       	add_option('solostream_options',$solostream_array);
       	$template = get_option('solostream_template');
       	$saved_options = get_option('solostream_options');
       	foreach($template as $option) {
       		if($option['type'] != 'header'){
       			$id = $option['id'];
       			$std = $option['std'];
       			if(empty($saved_options)) {
       				update_option($id,$std);
       				$solostream_array[$id] = $std;
       			}
       			else { //Store the old values over again.
       				$solostream_array[$id] = $saved_options[$id];
       			}
       		}
       	}
       	update_option('solostream_options',$solostream_array);
       }
   
       ...
       ```
   
 * As you can see its a Solostream theme. So the question now is how and where from
   do I call this solostream_option_setup() function? Hopefully that should do it
   🙂

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