Forum Replies Created

Viewing 14 replies - 16 through 29 (of 29 total)
  • Thread Starter Sub_Zero

    (@sub_zero)

    Ok thanks, I was reading many tutorial but still I don’t get it.

    Here is my current code:

    // functions.php
    add_action('init', 'mylink_button');
    
    function mylink_button() {
    
    	if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') ) {
    		return;
    	}
    
    	if ( get_user_option('rich_editing') == 'true' ) {
    		add_filter( 'mce_external_plugins', 'add_plugin' );
    		add_filter( 'mce_buttons', 'register_button' );
    	}
    
    }
    
    function register_button( $buttons ) {
    	array_push( $buttons, "|", "mylink" );
    	return $buttons;
    }
    
    function add_plugin( $plugin_array ) {
    	// main.js is saved into: wp_content/themes/myTheme/assets/js/main.js
    	$plugin_array['mylink'] = get_bloginfo( 'template_url' ) . '/assets/js/main.js';
    	return $plugin_array;
    }
    // main.js
    (function() {
    	alert('test'); // Even no alert!!
        tinymce.create('tinymce.plugins.mylink', {
            init : function(ed, url) {
                ed.addButton('mylink', {
                    title : 'My Link',
                    image : url+'/mylink.png',
                    onclick : function() {
                         ed.selection.setContent('[mylink]' + ed.selection.getContent() + '[/mylink]');
    
                    }
                });
            },
            createControl : function(n, cm) {
                return null;
            },
        });
        tinymce.PluginManager.add('mylink', tinymce.plugins.mylink);
    })();

    This code does pretty much nothing! I added that alert(‘test’) to see if there is something wrong with my main.js. It seems like it can’t get loaded.

    Any ideas what I’m doing wrong?

    Thread Starter Sub_Zero

    (@sub_zero)

    Thank you Inzerillo! Black Studio TinyMCE Widget is just what I wanted!! 🙂

    Thread Starter Sub_Zero

    (@sub_zero)

    Ok, I found a solution. There you go, world:

    add_filter( 'locale', 'wpse_52419_change_language' );
    function wpse_52419_change_language( $locale )
    {
    	return 'de_DE';
    }
    Thread Starter Sub_Zero

    (@sub_zero)

    Oh wow … you are good! 🙂

    I am not the author of this. It’s just a template so you can build your own theme on it. I don’t know what’s the point of this function. I have just removed everything on that file and now everything works fine! I hope I won’t miss this function in the future because anything won’t work then. I am sure the author had a reason to write it but for now I’m happy without it.

    Anyway, thank you so much for your help. I appreciate it!

    Thread Starter Sub_Zero

    (@sub_zero)

    Thank you for testing it.
    I have figured out that it’s not really a matter of the fonts. I think it’s more something wrong with the directory. Because I have just created test.css on /assets/fonts/ and also this simple file appears as 404!

    I also created other directories and put that test.css file into them but yet the same 404 error. The test.css only gets loaded when it’s into the directory assets/css/.
    I have no idea why and how I could change that?!

    Edit: I have now moved all those bootstrap fonts to the directory /assets/css/ and added this to my css:

    @font-face{ font-family:'Glyphicons Halflings';src:url(glyphicons-halflings-regular.eot);src:url(glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(glyphicons-halflings-regular.woff) format('woff'),url(glyphicons-halflings-regular.ttf) format('truetype'),url(glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}

    The fonts are now getting loaded normally. It is a solution but I’m still wondering why I can’t put anything into other directories?!

    Thread Starter Sub_Zero

    (@sub_zero)

    Oh wow, that’s exactly what I was looking for. Thank you so much!!

    Forum: Fixing WordPress
    In reply to: CSS returns 404
    Thread Starter Sub_Zero

    (@sub_zero)

    @claytonjames thank you for trying to help. I was able to solve this problem now. Since this theme ALWAYS worked for me, I couldn’t imagine that there is something wrong with the code. So I reinstalled WordPress, just to make sure WordPress is not fooling. Then I realized even the CSS of WordPress is not getting loaded. So the problem was XAMPP. I don’t know what exactly was wrong with it but after I reinstalled XAMPP, everything worked perfectly and all CSS files could get loaded normally.

    Forum: Fixing WordPress
    In reply to: CSS returns 404
    Thread Starter Sub_Zero

    (@sub_zero)

    This forwards me to the page of XAMPP: http://localhost/xampp/

    Forum: Fixing WordPress
    In reply to: CSS returns 404
    Thread Starter Sub_Zero

    (@sub_zero)

    No, that’s a 404.

    Forum: Fixing WordPress
    In reply to: CSS returns 404
    Thread Starter Sub_Zero

    (@sub_zero)

    @donhoward The file definitely exists. Because if I run the following path on my browser, I get the css file opened with my editor: C:\xampp\htdocs\akorug\wp-content\themes\akorug\assets\css\app.css

    @chris I tried that code but it still doesn’t change anything. My CSS can’t still get loaded.

    Forum: Fixing WordPress
    In reply to: CSS returns 404
    Thread Starter Sub_Zero

    (@sub_zero)

    I am just trying to bind my css file.

    This is what my browser shows me in the source code: <link rel=”stylesheet” href=”/akorug/assets/css/app.css”>

    The css file doesn’t get loaded though. If I click on “/akorug/assets/css/app.css” in the source-view, I get forwarded to a 404 page.

    Thread Starter Sub_Zero

    (@sub_zero)

    webbrewers that’s perfect. Thank you so much!!

    Thread Starter Sub_Zero

    (@sub_zero)

    I solved it this way:

    In the hosts file (C:\Windows\System32\drivers\etc):

    127.0.0.1 mysite

    in the httpd-vhosts.conf (C:\xampp\apache\conf\extra)

    <VirtualHost *:80>
        ServerAdmin myemail@gmail.com
        DocumentRoot "/xampp/htdocs/wordpress"
        ServerName mysite
    </VirtualHost>

    Just in case somebody is planing to do the same.

    Thread Starter Sub_Zero

    (@sub_zero)

    Thank you for your reply, Mr. Invisible!

Viewing 14 replies - 16 through 29 (of 29 total)