Tumgik
mukkoo · 11 years
Photo
Tumblr media
weLab ha compiuto 2 anni oggi!
0 notes
mukkoo · 11 years
Text
Users to Csv: Wordpress plugin
Tumblr media
Another product weLaika branded is the little plugin called "Users to csv".
With this plugin you can export all users fields that you want (selecting it by checkbox) in CSV format.
Installation:
Download here and unzip in your plugins/ folder
Go to the dashboard in plugins section
Activate "Users to Csv"
Into the dashboard go to Users > Export to CSV for settings page
good work!
1 note · View note
mukkoo · 11 years
Text
Short guide for Sublime Text 2 workflow
You use Sublime Text 2 and want to improve your workflow? This short guide, made in weLaika, can help you. Download it for free here.
Tumblr media
1 note · View note
mukkoo · 11 years
Text
weLaika for Sublime Text 2
We know that a lot of developers use daily Sublime Text 2 so we have decided to contribute at their, and our, workflow with two packages.
This two packages are dedicated to autocompletations, so useful coding your web projects.
The first is Wordless oriented and help you to put all the helpers in project.
You can download and contribute it on github github.com/welaika/Sublime-Text-2-Wordless also you can download it directly via Package Control into Sublime Text.
Tumblr media
The second is compass oriented and help you to put all the compass and blueprint mixins in your sass project, you can download and contribute it on github github.com/welaika/Sublime-Text-2-Compass-Mixins.
So, good coding!
1 note · View note
mukkoo · 12 years
Text
WP tricks: posts to the future
Tumblr media
In a recent WordPress work, I had to publish, with an external PHP script, a lot of posts with wp_insert_post() function. These posts had a non common feature: the ‘post_status’ was ‘publish’ and the ‘post_date’ was in the future.
Normally, in WordPress, the posts with a date in the future have ‘post_status’ ‘future’ but, in this case, I couldn’t set it because the wordpress query shows in the frontend only published posts.
So the problem is that they don’t appear in any query because the WordPress query shows only posts with present date or before.
The solution
Add in your functions.php in the theme folder, or in hooks.php if you use Wordless, this function:
function show_posts_to_the_future($where = '') { $cut = "AND post_date <= '". date('Y-m-d', strtotime('now')) ."'"; $where = str_replace($cut, "", $where); return $where; }
removing the “WHERE post_date” condition into the query. If you want a specific range in the future you can add this line:
$where .= " AND post_date < '" . date('Y-m-d', strtotime('+365 days')) . "'";
So you must override (in the same position) another function that launches the filter hooked by specific event:
function show_future($query) { add_filter('posts_where', 'show_posts_to_the_future'); }
For example, if you want to limit this query you can add an if condition before the add_filter. In my case it was only for backend and for a specific post_type:
if (is_admin() && ($query->query['post_type'] == 'book')){}
Now we must add an hook with an add_action(): add_action(‘pre_get_posts’, ‘show_future’);
This action hooks all queries. So you can view the Posts to the Future!
4 notes · View notes
mukkoo · 12 years
Text
New Wordless helpers
Tumblr media
We use WordPress and we love Wordless, our framework. Here is a summary of a new set of Wordless helpers, that you’ll find in the new version.
is_subpage($id) Implements WordPress Conditional Tags. Checks if the current page is a subpage and returns the parent post ID if true. if you pass a page ID as a parameter it can check if it is a subpage of a specific parent page.
is_valid_url($url) Checks if the string $url is a valid URL
resize_image($src, $width, $height) Resizes the specified image to the specified dimensions. The crop will be centered relatively to the image. If the file does not exist, it will be created and saved into the tmp folder. After the first creation, the cached file will be served when calling this function. $src: The path of the image to be resized. $width: The width at which the image will be cropped. $height: The height at which the image will be cropped. return string: The valid URL to the resized image.
get_post_attachments($post_id) Gets the attached files in a post ($post_id)
get_current_attachment() Gets the attached files in current post detect_user_agent() This function includes a PHP class (Mobile Detect - Version 2.5.2 - commit b5b8992dbe) to detect mobile devices and user agent details. To use it, simply call the function detect_user_agent() in your view and then call one of the avaible methods. Example: $detect->isMobile() More details here https://github.com/serbanghita/Mobile-Detect
truncate($text, $options = array()) —UPDATE— Truncates the text to the specified length. $text: The text to be truncated. $options (optional): An array with options to be passed to the function. Available options: - length (default 30): the length at which truncate the text - omission (default ‘…’): the suffix string to be added to the truncate text - word_count (default FALSE): if it’s TRUE the length is counted in words, if it’s FALSE it’s counted in characters - separator (default FALSE): the separator string used to trim the argument - html (default FALSE): sets if you want to preserve html in the string. If it’s set to false remove ALL HTML tags. - allowed_tags (default array(‘b’, ‘i’, ‘em’, ‘strong’)): if html is TRUE it preserves the allowed tags. If this parameter is set to ‘all’, the function will leave untouched the string. Return: The truncated text.
Good work!
6 notes · View notes
mukkoo · 12 years
Text
Wordless: less code, more WordPress
Since weLaika was born, one of our best efforts was focused on using WordPress, one of the most flexible and widely-adapted Content Management Systems. One of the main concerns we had with this otherwise fantastic framework was the quantity of code we had to constantly rewrite inside each single WordPress installation to allow our theme templates to work.
So we started to think about how we could optimize the process of bootstrapping the basic structure of our theme templates. And we started experimenting :)
At first, we created wp_haml_sass (wp_haml_sass).
The first attempt was still missing some development feature, was more complex to deploy and had a few amount of helpers. So we decided to spend some more development time on our framework.
The result of our work was Wordless.
What is Wordless?
Wordless is a WordPress plugin (how about that?) that allow programmers to write better code with new, shiny and improved working tools.
So what can I do with Wordless?
WordLess makes you write better code: better code means simpler, more functional and rational code. Thanks to the Rails framework, we had a clear idea of how to improve the code structure in our themes: we borrowed from Rails the folder structure and the concept of controlling the routing of the theme from just one router file.
WordLess brings along a set of improved working tools: you can write your views using pHAMLp (a PHP porting of HAML), your stylesheets with SASS and Compass and your javascript code with Coffeescript.
I bet you are very puzzled right now.
“WHAT ARE ALL THESE CRAZY STUFF? I WANT PURE HTML FOR MY VIEWS, PURE CSS FOR MY STYLESHEETS AND PURE JAVASCRIPT FOR MY JAVASCRIPT”
Well, there is no excuse from us. We just happen to like these things.
We find these tools terribly good for writing elegant, concise and maintainable code. They work well and do wonders for us. We think that you may like to learn something new and try them on.
That is all, we’re not crazy hipsters: we just want to user the best tool for the job and we really find this stuff amazing. But if you feel like these tools do not fit your needs, you can always use plain PHP, CSS and JS in your Wordless theme. It’s ok with us.
Does it actually work?
We currently use Wordless for all our client WordPress work. We know it’s not (yet!) perfect but we also know that it dramatically improved our life as programmers.
To make it even more awesome, we filled Worldless with a tons of helpers (I mean like fifty or something!), we added preset code for hooks, custom post types, menus and thumbnails management in the Wordless theme generator. In the upcoming articles, we’ll explain them in a much closer detail.
I’m not scared, how do I install this?
You can find all the documentation on the Github repo. Please report to us any question and bugs you may happen to bump into, we will be very much grateful.
1 note · View note