Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter leticia

    (@leticia5959)

    Thread Starter leticia

    (@leticia5959)

    Hi

    Here is how I solve my problem:

    // Creating rewrite rules and query variables
    add_filter('query_vars', 'handle_query_vars');
    add_filter('rewrite_rules_array', 'handle_rewrite_rules_array');
    // Flush the rewrite rules
    add_action('init', 'handle_flush_rewrite');
    // Add filter to show template
    add_filter('home_template', 'handle_home_template');
    
    function handle_rewrite_rules_array($rules) {
        $newrules['.*/images$'] = 'index.php?showimages=1';
    
        $newrules = array_merge($newrules,$rules);
        return $newrules;
    }
    
    function handle_query_vars ( $vars ) {
        $vars[] = "showimages";
        return $vars;
    }
    
    // Function to change the home template
    function handle_home_template($template_dir) {
        if (get_query_var("showimages"))
    	'dir_to_page/custom_page.php';
        else
    	return $template_dir;
    }
    
    function handle_flush_rewrite() {
        global $wp_rewrite;
        $wp_rewrite->flush_rules();
    }

    Regards

    Thread Starter leticia

    (@leticia5959)

    Hi

    I solve with ‘query_vars’ and ‘rewrite_rules_array’ filters.

    Regards

    Hello

    Thanks for the report. The code is updated as hopeac suggest.

    Regards
    Leticia

    Hi

    I test the code of benlag and hansvedo and even the Editor appears, the buttons of “Add an Image”, “Add video” and “Visual” doesn’t works, no error and nothing happens.

    The button “HTML” gives me the JavaScript error “switchEditors is not defined”.

    The buttons of “b”, “i” works fine.

    The other problem is that when I write, the text appears in white colour, I only can see what I type if I mark the text.

    Any tip will be appreciated.

    Thanks in advanced.
    Leticia

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