KaiserK108
Members
-
Joined
-
Last visited
Reputation Activity
-
74kb and 98kb is very heavy for stylesheet files, I've built some pretty comprehensive sites that run on one CSS file weighing in at less than 50kb (unminified). Even for a homepage I'd expect the CSS file to be relatively small since most styles won't be used there.
It's not unusual for sites to use several CSS files, use of 3 is fairly common (eg for base, layout and typography), and CMS's like Wordpress can add dozens if you're not careful.
That said, page speed is important nowadays and downloading one CSS file as opposed to two or more is normally more efficient.
-
KaiserK108 reacted to Creativescript in Do you use a framework?I'm not to sure what you are asking.
but for CSS although it isn't really a framework i use SASS which makes coding CSS that little bit more smoother and quick, then i bundle this with bourbon and neat for mobile responsive goodness.
Also dabbled in bootstrap, although its good i found it a little to bloated for responsive sites and included a ton of things i never even used, hence the switch to sass, bourbon and neat.
-
KaiserK108 got a reaction from PipeTenHostingCarl in how to use @font-faceAs @Fuzzy Logic pointed out, Font Squirrel will generate all the necessary files for ya...
-
KaiserK108 got a reaction from cairns84 in how to use @font-faceHi @cairns84,
Currently, in your CSS you have:
@font-face { font-family: 'African'; /*a name to be used later*/ src: url('fonts/african'); /*URL to font*/ } You're not specifically referencing any files! As an example, it should follow the following format:
@font-face { font-family: 'AfricanFont'; src: url('african-font.eot'); /* IE9 Compat Modes */ src: url('african-font.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('african-font.woff') format('woff'), /* Modern Browsers */ url('african-font.ttf') format('truetype'), /* Safari, Android, iOS */ url('african-font.svg#svgFontName') format('svg'); /* Legacy iOS */ } First line, you are declaring the font family name; secondly, you are telling the browser where to find the specific file for that font.
Then to apply that font to a specific element, eg h1 you do the following:
h1 { font-family: 'AfricanFont', (some-fallback), (font-style: eg, serif or not); } -
KaiserK108 got a reaction from cairns84 in how to use @font-faceAs @Fuzzy Logic pointed out, Font Squirrel will generate all the necessary files for ya...
-
KaiserK108 got a reaction from danners2003 in how to use @font-faceHi @cairns84,
Currently, in your CSS you have:
@font-face { font-family: 'African'; /*a name to be used later*/ src: url('fonts/african'); /*URL to font*/ } You're not specifically referencing any files! As an example, it should follow the following format:
@font-face { font-family: 'AfricanFont'; src: url('african-font.eot'); /* IE9 Compat Modes */ src: url('african-font.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('african-font.woff') format('woff'), /* Modern Browsers */ url('african-font.ttf') format('truetype'), /* Safari, Android, iOS */ url('african-font.svg#svgFontName') format('svg'); /* Legacy iOS */ } First line, you are declaring the font family name; secondly, you are telling the browser where to find the specific file for that font.
Then to apply that font to a specific element, eg h1 you do the following:
h1 { font-family: 'AfricanFont', (some-fallback), (font-style: eg, serif or not); } -
KaiserK108 got a reaction from Jane B in Is it a bad idea to have a longish tagline?Hi Jane,
Off the top of my head, I don't believe there is. The only consideration would be the visual aspect of it - how does it appear at the different screen sizes (eg mobile display) etc.
-
KaiserK108 reacted to teodora in How to create Business website ?Alright, looking at your Introduction, it says you are a web developer.
Obviously if you a web developer, you should know how to create a site....
-
KaiserK108 reacted to jasondexter in Bounce Rate ?Another issue with BR is the fact it doesn't (in GA at least) account for time on that single page.
We've another analytics tool that show visit duration, of those that bounce the majority spend at least a minute on our site's page. Yet GA calls them ALL bounces, which isn't a fair assessment.
Te very definition of a bounce is someone who lands on one page and then leaves. So you can't say that someone that only views one page but stays on there for an hour isn't a bounce. Because it is.
Create a custom segment using a condition that looks at page views of less than 2. This way, you can then segment the visitor information right there in GA. You can go as far as creating multiple segments for individual traffic sources and view any trends that might occur across multiple sources.
I'd then use custom variables (dimensions in UA) on pages to determine which bit of content led to a conversion (for articles), whether those that share content are likely to convert, on ecom stores to map the patterns of returning customers (a CV that looks at those that have purchased more than 3 times and look at that data).
-
KaiserK108 reacted to MMMedia in Bounce Rate ?Another issue with BR is the fact it doesn't (in GA at least) account for time on that single page.
We've another analytics tool that show visit duration, of those that bounce the majority spend at least a minute on our site's page. Yet GA calls them ALL bounces, which isn't a fair assessment.
-
KaiserK108 got a reaction from mantis in Implementing jQuery and javascript in WpHi @ars Firstly, forgive me for the essay, but stick with me. Let's start by breaking down what @welshhuw first suggested You're declaring a function (custom_scripts) /*------------------------------------ Enqueue JS Scripts ------------------------------------*/ // Register Script/s function custom_scripts() { //code to execute when function is run //see welshhuw's original example }
which when run will: de-register Wordpress's inbuilt jQuery,
register YOUR SPECIFIED version (in this instance 1.8.3)
and then enqueues it to the HEADER
(^^^You ONLY need to do these first 3 steps, IF you need a specific version of jQuery)
Registers a new script ('customJS') - gets it ready, tells WordPress we want to use this
Enqueues it (outputs the file, in this case 'customJS') to the FOOTER. Then, you are using one of the available wordpress hooks (wp_enqueue_scripts), to run this function ('custom_scripts'). // Hook into the 'wp_enqueue_scripts' action add_action( 'wp_enqueue_scripts', 'custom_scripts' );
That means when Wordpress runs that action, your function will also run. Within that function ('custom-scripts'), you can register as many scripts as you like, and then enqueue them as necessary. Then you run that function once, and it will run everything declared inside it. As I stated above, registering a script get its ready for use, and tells Wordpress I'm going to use this script; here's the format:
<?php wp_register_script( $handle, $src, $deps, $ver, $in_footer ); ?>
$handle = the name of the script, eg 'customJS' $src = is the source of the file eg [path to template directory] 'js/customJS.js' $deps = dependencies (if the script relies on another script first, for examle Jquery, or in your case, fancybox thumbs is prbably dependent on fancybox.pack (not sure, never used it)) $ver = what version you're using $in_footer = whether the script appears in footer or not (true for yes, false for no). So here's an example:
function my_custom_scripts() { wp_register_script( 'script1', get_template_directory_uri().'/js/script1.js', array('jquery'), '', false ); wp_register_script( 'script2', get_template_directory_uri().'/js/script2.js', array('script1'), '', true ); wp_register_script( 'script3', get_template_directory_uri().'/js/script3.js', array(), '', true ); wp_enqueue_script( 'script2' ); if ( is_front_page() ) { wp_enqueue_script('script3'); } }
So, now a breakdown: we declared 1 function: 'my_custom scripts' Registered script1, which is dependent on 'jQuery', and will be output to the header Registered script2, which is dependent on 'script1', and will be output to the footer Registered script3, which will be output to the footer Then, we enqueue script2 then we set a conditional, and say to enqueue script 3 only if it is the front page. Next we do this:
add_action( 'wp_enqueue_scripts', 'my_custom_scripts' ); That means, when 'wp_enqueue_scripts' runs, it will also run our function 'my_custom_scripts':
which in turn registers 3 different scripts
then enqueues (outputs) script 2, which is dependent on script 1 (so it will automatically run script1), which in turn is dependent on jQuery (so it will automatically run that first);
then it will check if it is the front-page, and then output script3.
Hope that made sense... and then have a look back at your code, and break down what you're trying to do, and see if you can get it to fit into this pattern. (Declare one function, register all your scripts in there, and think about dependencies), then enqueue those which need to be called, and in the right places), and then, call that function once by hooking it into wp_enqueue_scripts. Let me know how you get on... -
KaiserK108 got a reaction from mantis in Implementing jQuery and javascript in Wp@ars,
you can move all those snippets to a separate file; eg . "plugins.js", and then call back the file in the same way @welshhuw described above.
Wrap all the snippets with the following function:
jQuery(document).ready(function($) { //Your custom snippet 1 //Your custom snippet 2 //Your custom snippet 3 }); This will only execute the contents after page load (and thus, you don't need to call it on every function), and it also means you can use the $ sign safely.
The Wordpress codex describes the process and reasoning in much better detail:
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
-
KaiserK108 reacted to jasondexter in Backlinks Backlinks Backlinks.....Hold on, I have 2004 on the phone for you...
Yeah, because you don't want to use anything spammy do you...
Why don't you use link wheels and web 2.0s!! I hear they're all the rage...
Okay I'm just pulling your leg but seriously, don't use that ****. Are you using it on clients websites or your own? I hope you don't want to pay because your tight and not because you think it's spammy so you use free link exchanges instead to not fall foul of Google.
Whilst you're spending time getting those crummy links, you could be writing awesome content, leveraging Google+, implementing some awesome schema, marketing your website on community forums and driving traffic to your website.
Some people will tell you link exchanges work, but on a large scale you'll either 1)never rank in a million years or 2) Rank for a crummy long tail keyword and not achieve any more than a few hits per month.
-
KaiserK108 got a reaction from welshhuw in Implementing jQuery and javascript in Wp@ars,
you can move all those snippets to a separate file; eg . "plugins.js", and then call back the file in the same way @welshhuw described above.
Wrap all the snippets with the following function:
jQuery(document).ready(function($) { //Your custom snippet 1 //Your custom snippet 2 //Your custom snippet 3 }); This will only execute the contents after page load (and thus, you don't need to call it on every function), and it also means you can use the $ sign safely.
The Wordpress codex describes the process and reasoning in much better detail:
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
-
KaiserK108 reacted to JackDanielTracy in User TestingI was just wondering if anyone else has used http://peek.usertesting.com before? I came across the link on Twitter, and got them to do a review on my Portfolio (you can do up to three sites a month free). 48 hours later, I got sent back a 4 minute video of someone using my website and commentating throughout about what they liked/disliked, and why they clicked in certain places (It's also interesting to watch where they put their curser!).
I'm not sure who the person was behind the video, and wether they were also a web designer etc, but to me it sounded like a genuine 'guinea pig'. The site is currently in beta, so will be interesting to see what direction Peek goes in.
I've put this in the Reviews/Feedback Section, as I think this can be quite a useful resource!
-
KaiserK108 reacted to welshhuw in Implementing jQuery and javascript in WpHi.
You should always use your functions.php to load scripts and styles. WordPress comes bundled with jQuery already but if you want to change your version use the snippet below:
/*------------------------------------*\ Enqueue JS Scripts \*------------------------------------*/ // Register Script/s function custom_scripts() { if (!is_admin()) { wp_deregister_script( 'jQuery' ); wp_register_script( 'jQuery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', false, '1.10.2', false ); wp_enqueue_script( 'jQuery' ); wp_register_script('customJS', get_template_directory_uri() . '/assets/js/custom-scripts.js', array(), '1.0.0', true); // Custom scripts wp_enqueue_script('customJS'); // Enqueue it! } } // Hook into the 'wp_enqueue_scripts' action add_action( 'wp_enqueue_scripts', 'custom_scripts' ); I hope that helps.