Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • desie314

    (@desie314)

    I basically solved this by outputting the gtranslation menu in a hidden div in the footer, and then using jquery to detach the contents and append it into the popup. Then when the popup is closed, do the reverse. Its dirty but its elementor.

    Add the following to Elementor > Custom Code. I set mine to add to the head but anywhere would probably work.

    <script>
    jQuery( document ).on('elementor/popup/show', function () {
    var $el = jQuery('#my-gtranslate-div').detach();
    if ($el.length) {
    $el.children('.gt_switcher_wrapper').removeAttr('style');
    jQuery('#my-popup-div').append($el);
    }
    });
    jQuery( document ).on('elementor/popup/hide', function () {
    var $el = jQuery('#my-gtranslate-div').detach();
    if ($el.length) {
    jQuery('#my-hidden-div').append($el);
    }
    });
    </script>

    Add #my-gtranslate-div to “Wrapper selector CSS” in gtranslate settings and add <div id="my-hidden-div" style="display: none"><div id="my-gtranslate-div"></div></div> to the footer template or where ever it can get output on every page.

    And add <div id="my-popup-div"></div> to an html widget in the popup.

    My gtranslate was configured to be “flags with language names”, if that matters.

    Forum: Plugins
    In reply to: [New Blog Defaults] setup()

    also missing Post name in common settings (permalinks)

    Forum: Plugins
    In reply to: [New Blog Defaults] setup()

    a variable typo error is on line 440:
    else {$newoptions['use_smiles'] = 0;}
    change ‘use_smiles’ to ‘use_smilies’

    agreed, great plugin.

    Thread Starter desie314

    (@desie314)

    I figured it out. I was close. All I had to do was return false in my function.

    Thread Starter desie314

    (@desie314)

    I found the issue. It was an un-closed <div> tag in the easyrecipe-format.html file.

    Thread Starter desie314

    (@desie314)

    alright, thanks.

    Thread Starter desie314

    (@desie314)

    I seem to have found a solution. I simply modified my .htaccess file as follows:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^getpage/?$ wp-content/custom-pages/getpage.php [QSA,L]
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    </IfModule>
    
    # END WordPress

    The only thing I did was add the following line:
    RewriteRule ^getpage/?$ wp-content/custom-pages/getpage.php [QSA,L]

    I have tried this before but it didn’t work. It may be the [QSA,L] that I found in a google search that makes it work this time.

    I was initially trying to add this line to htaccess internally with the use of non_wp_rules but this did not update the htaccess file. Not even after flushing the rules with $wp_rewrite->flush_rules(); or by saving the settings on the admin permalink settings page.

    I’m afraid that the htaccess file will be overwritten at some point and my rule will not be there.

    Thread Starter desie314

    (@desie314)

    yes I can still access wp-admin. I did not alter the htaccess file. I only did the php. I’m not sure if saving the permalink settings does a hard or soft flush. If it is hard then it will rewrite the htaccess file assuming it is able. But this doesn’t seem to affect any of the ‘old’ or ‘new’ links.

    Thread Starter desie314

    (@desie314)

    Solution FOUND!
    Seems part of the problem was that my test file was in the root. I moved it to any subsequent folder and used this code in a plugin (would probably work in the theme functions.php file too) and it works.

    add_action('generate_rewrite_rules', 'geotags_add_rewrite_rules');
    
    function geotags_add_rewrite_rules( $wp_rewrite )
    {
      $new_rules = array(
         '^getpage/?$' => 'wp-content/custom-pages/getpage.php' .
           $wp_rewrite->preg_index(1) );
    
      // Add the new rewrite rule into the top of the global rules array
      $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
    }

    cache needs to be flushed in order for this to take effect so you can either save changes to the permalink settings page in the admin section or use this code:

    add_action('admin_init', 'flush_rewrite_rules');

    This solution was found in the wp codex at:
    http://codex.wordpress.org/Custom_Queries

    I actually gave up (for the day) and was looking up how to do custom queries and there it was, eureka!

    Thread Starter desie314

    (@desie314)

    any other suggestions? I’ve been fiddling with the $wp_rewrite object, still haven’t found a solution. And google isn’t helping atm.

    Thread Starter desie314

    (@desie314)

    Your solution seems to be correct but it is not working for some reason. I just get page not found. This is what I have in my .htaccess file (getpage.php is the name of the file):

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^getpage/? getpage.php [NC]
    </IfModule>
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    </IfModule>
    
    # END WordPress
    Thread Starter desie314

    (@desie314)

    Thanks for the help!

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