Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter big_s

    (@big_s)

    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.

    Thread Starter big_s

    (@big_s)

    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?

    Thread Starter big_s

    (@big_s)

    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.

    Thread Starter big_s

    (@big_s)

    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.

    Thread Starter big_s

    (@big_s)

    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.

    Thread Starter big_s

    (@big_s)

    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.

    Thread Starter big_s

    (@big_s)

    Haha thanks Rajesh, such a simple things I couldn’t see it!

    Nice one ??

    Thread Starter big_s

    (@big_s)

    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.

    Thread Starter big_s

    (@big_s)

    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)