Categories
Webdevelopment

LT Gruppen

At Layback, we work daily to digitize our customers. The LT Group is one of our customers who has really moved forward towards a more automated and efficient work day.

Categories
Layback

Congratz, 5 awards to Muf10

I am proud to say that Muf10.com have won 5 awards. Congratz to our team at Layback and Muf10 for the brilliant work. Looking forward to see more cool stuff from them.

Categories
Webdevelopment

SQL Search & replace

/*
    Insert this line in wp_posts -> Query.
*/

UPDATE wp_posts SET post_content = REPLACE(post_content, '[old domain]', '[new domain]');

Categories
Webdevelopment

Simple accordion

<dl class="accordion">
	<dt>This is a example title</dt>
	<dd>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</dd>
	
	<dt>This is a example title</dt>
	<dd>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</dd>
	
	<dt>This is a example title</dt>
	<dd>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</dd>
</dl>
/*

	NO CSS NEEDED

	THIS IS ONLY FOR THE DESIGNERS EYE

*/

dl{
	width: 100%;
	max-width: 768px;
	margin: 70px auto;
	border-bottom: 1px solid #ccc;
	dt{
		border-top: 1px solid #ccc;
		padding: 15px 0;
		cursor: pointer;
		font-size: 18px;
		font-weight: 600;
	}
	dd{
		padding: 15px 0;
		margin: 0;
		font-size: 14px;
		line-height: 1.8;
	}
}
var accords = jQuery('.accordion > dd'),
	 accordsheading = jQuery('.accordion > dt');

accords.hide();

jQuery('.accordion > dt').click(function()
{
	if( jQuery(this).hasClass('active') )
	{
		accords.slideUp();
		accordsheading.removeClass('active');
	}
	else
	{
		accordsheading.removeClass('active');
		accords.slideUp();
		jQuery(this).next().slideDown();
		jQuery(this).addClass('active');
	}
	
	return false;
});
Categories
Webdevelopment

Search in specific post_type

HTML

<form action="/" method="POST">
	<input type="search" name="s" placeholder="">
	<button type="submit" type="search-button"><?php _e('Search', 'layback'); ?></button>
	<input type="hidden" name="post_type" value="product" />
</form>
Categories
Webdevelopment

WP_Query inside The loop

<?php
	$args = array(
		'post_type' => 'CUSTOM POST TYPE NAME',
		'posts_per_page' => -1,
		'order' => 'ASC',
		'orderby' => 'date'
	);
	$custom_loop = new WP_Query( $args );
?>
<?php while ( $custom_loop->have_posts() ) : $custom_loop->the_post(); ?>
	<div><?php the_title(); ?></div>
	<div><?php the_content(); ?></div>
<?php
    endwhile;
    wp_reset_postdata();
?>