Forum Replies Created

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

    (@jumat)

    @prashantvatsh the folder with the active theme and all of it’s content was locked. However, one level up, it was possible to rename the folder containing all the themes. It worked making a duplicate of that folder and modifying the content of the functions.php file.
    Thanks for all the your previous answers!

    Thread Starter jumat

    (@jumat)

    Is there a way to reset everything? At this point I don’t mind getting to restore my latest backup even if I loose some of the more recent edits.
    Since I can’t access wp admin, I can’t just use updraft to restore my latest backup.

    I have tried to delete all files on my laptop, uninstall WP and download it again from bitnami. After I install it on my mac and I launch it, it goes back to the same error like if it had saved somewhere(where?) the informations from the previous install. Anyone able to help on what am I doing wrong here?

    Thread Starter jumat

    (@jumat)

    You are not able to change the permissions of the files and folders so that it allows you to edit?

    Not through the standard way of changing permissions on mac. I try to set it to write and read but automatically reverts to “read only for all users” and it says that I don’t have the rights to change this setting.
    I also tried from terminal with sudo chflags -R nouchg but no luck.

    I found blogs explaining how to do this from wp-admin… but I don’t have access to that at the moment.

    • This reply was modified 5 years, 11 months ago by jumat.
    Thread Starter jumat

    (@jumat)

    Are you able to change the name of theme’s folder? If yes then please try loading the WordPress after changing the theme folder name. If not, please check the permissions.

    both the function.php file and the theme folder itself are locked and can’t be renamed/overwritten/modified/deleted. I can make a copy of it and fix the code, but then I’m not allowed to paste it back in the right location and delete the original file, so that wouldn’t work as a solution.

    Thread Starter jumat

    (@jumat)

    I think this means you have checked in your laptop folder. If yes, then you might be using any localhost server xampp/mamp etc.

    I checked and this was these were docs remaining from previous attempt of installation of xampp. However it wasn’t in use now and WordPress wasn’t installed within xampp.

    Uninstalling the WordPress will have no effect on the theme. So if you have access to your wp-admin, I will suggest activating another theme and then try editing your previous theme from Appearance -> Theme Editor.

    The problem is that I don’t have access to wp-admin. If I had that I could go in wp file manager and just edit the function.php doc of the theme back to how it was before. When I try to launch wp now it just sends me back to the fatal error message and seems like I can’t do anything from there.

    Please have a backup of your site before changing

    I have a recent backup done with updraft on drive. I could indeed restore this one if I could access wp-admim or somehow “rest” WordPress.

    Thread Starter jumat

    (@jumat)

    I’m actually not using Xampp, for now I was using WP only on my laptop and not on the local network.

    I searched for “functions.php” in finder and found over ten files with the same name. Opened one by one and found the one with the themes functions. I can see the code I added at the end but I can’t edit it because it says “You don’t own the file “functions” and don’t have permission to write to it.”

    This is the code. the part I added starts at “function custom_shortcode_func()”. Just after adding that, the site crashed. I assume it was related?

    <?php
    /**
     * Functions file - Calls all other required files
     *
     * PLEASE DO NOT EDIT THEME FILES DIRECTLY
     * unless you are prepared to lose all changes on the next update
     *
     * @package Fluida
     */
    
    // theme identification and options management - do NOT edit unless you know what you are doing
    define ( "_CRYOUT_THEME_NAME", "fluida" );
    define ( "_CRYOUT_THEME_VERSION", "1.8.4.1" );
    
    // prefixes for theme options and functions
    define ( '_CRYOUT_THEME_SLUG', 'fluida' );
    define ( '_CRYOUT_THEME_PREFIX', 'fluida' );
    
    require_once( get_template_directory() . "/cryout/framework.php" );		// Framework
    require_once( get_template_directory() . "/admin/defaults.php" );		// Options Defaults
    require_once( get_template_directory() . "/admin/main.php" );			// Admin side
    
    // Frontend side
    require_once( get_template_directory() . "/includes/setup.php" );       	// Setup and init theme
    require_once( get_template_directory() . "/includes/styles.php" );      	// Register and enqeue css styles and scripts
    require_once( get_template_directory() . "/includes/loop.php" );        	// Loop functions
    require_once( get_template_directory() . "/includes/comments.php" );    	// Comment functions
    require_once( get_template_directory() . "/includes/core.php" );        	// Core functions
    require_once( get_template_directory() . "/includes/hooks.php" );       	// Hooks
    require_once( get_template_directory() . "/includes/meta.php" );        	// Custom Post Metas
    require_once( get_template_directory() . "/includes/landing-page.php" );	// Landing Page outputs
    
    // FIN
    
    function custom_shortcode_func() {
    	ob_start();
    	$current_user = wp_get_current_user();
    	echo . $current_user->display_name . '<br />';
    	$output = ob_get_clean();
        return $output;
    }
    add_shortcode('current_user', 'custom_shortcode_func');

    I also tried to uninstall wordpress and reinstall it planning to then restore a recent updraft backup that would have been good enough. However when I uninstall and reinstall WP, nothing changes. It still gives the same error when I try to load the website.

    Thread Starter jumat

    (@jumat)

    marking as solved

    Thread Starter jumat

    (@jumat)

    Thank you Nickolas! It works beautifully 🙂

    Thread Starter jumat

    (@jumat)

    Thank you Nickolas,
    when you say to put it right below the shortcode do you mean just within the wordpress block? (I imagine is a beginner question, I tried to research this but couldn’t find a solution)

    If I paste it like in the box below, on the website it just shows the unchanged fields, and then the text code just under the fields:

    [wordpress_file_upload userdata="true" userdatalabel="your name|t:text|s:top|r:1|a:1|p:none|d:/your message|t:multitext|s:top|r:1|p:none"] 
    
    <script type="text/javascript">
    if(window.addEventListener) { window.addEventListener("load", wfu_limit_field_length, false); } else if(window.attachEvent) { window.attachEvent("onload", wfu_limit_field_length); } else { window["onload"] = wfu_limit_field_length; }
    function wfu_limit_field_length() {
        var sid = 1;
        var fid = 1;
    	var len = 15;
        var obj = GlobalData.WFU[sid].userdata;
        var props = obj.props[fid - 1];
        var field = document.getElementById("userdata_" + sid + "_field_" + props.key);
        var listeners = getEventListeners(field)["DOMAttrModified"];
        if (listeners) for (var i = 0; i < listeners.length; i++) field.removeEventListener("DOMAttrModified", listeners[i].listener);
        var listeners = getEventListeners(field)["textInput"];
        if (listeners) for (var i = 0; i < listeners.length; i++) field.removeEventListener("textInput", listeners[i].listener);
        var listeners = getEventListeners(field)["input"];
        if (listeners) for (var i = 0; i < listeners.length; i++) field.removeEventListener("input", listeners[i].listener);
        var listeners = getEventListeners(field)["change"];
        if (listeners) for (var i = 0; i < listeners.length; i++) field.removeEventListener("change", listeners[i].listener);
        var listeners = getEventListeners(field)["keypress"];
        if (listeners) for (var i = 0; i < listeners.length; i++) field.removeEventListener("keypress", listeners[i].listener);
        var listeners = getEventListeners(field)["paste"];
        if (listeners) for (var i = 0; i < listeners.length; i++) field.removeEventListener("paste", listeners[i].listener);
        var listeners = getEventListeners(field)["focus"];
        if (listeners) for (var i = 0; i < listeners.length; i++) field.removeEventListener("focus", listeners[i].listener);
        var listeners = getEventListeners(field)["propertychange"];
        if (listeners) for (var i = 0; i < listeners.length; i++) removeEventListener("propertychange", listeners[i]);
        obj.attachHandlers(props, function(e) { if (e.target.value.length <= len) props.store(); else e.target.value = props.getstored(); });
    }
    </script>

    I have also tried to edit it in the file upload control panel but can’t save and update after the change.

    Could you suggest how to proceed?

    Thanks!
    Matteo

    • This reply was modified 5 years, 12 months ago by jumat.
Viewing 9 replies - 1 through 9 (of 9 total)