Skip to content

Instantly share code, notes, and snippets.

View madalinignisca's full-sized avatar
🏡
Open for business

Madalin Ignisca madalinignisca

🏡
Open for business
View GitHub Profile
@madalinignisca
madalinignisca / index.html
Created January 22, 2013 09:26
Equal column height with jQuery
<div class="container">
<h1>Equal column height with jQuery</h1>
<p>Float-based columns with equal height. The height of all the columns is determined by the highest column via jQuery. Each column height is dividable by 28px, so it will fit the underlying (28px based) grid nicely.</p>
<p>Happy coincidence: a plugin with a similar title was released today on jQuery plugin registry - <a href="http://plugins.jquery.com/equalheightcols/">jQuery equal height columns plugin</a>. It sounds similar but it does the <a href="http://aamirafridi.com/jquery/jquery-equal-columns-height-plugin">opposite</a> - i.e. it shortens all the columns to a predifined height.</p>
<button id="toggle">Toggle javascript</button>
<button id="toggle-grid">Toggle grid</button>
</div>
<div class="container" id="container">
<section class="site-section brown">
<!doctype html>
<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]-->
<head>
@madalinignisca
madalinignisca / wordpress-default.css
Created May 13, 2013 13:07
Default WordPress classes for using with CSS
/**
* Default Body Class Styles
*/
.rtl {}
.home {}
.blog {}
.archive {}
.date {}
.search {}
@madalinignisca
madalinignisca / content-excerpt.php
Last active December 18, 2015 22:08
WordPress limited content and better excerpt
<?php // place this 2 functions in your functions.php file (best would be to rename them)
/*
* https://gist.github.com/16nsk/5851926
*/
function excerpt($limit = 50) {
$excerpt = explode(' ', get_the_excerpt(), $limit);
if (count($excerpt)>=$limit) {
array_pop($excerpt);
@madalinignisca
madalinignisca / replace-title-with-logo.css
Created July 1, 2013 21:56
Replace title with logo example the better way (solves some performance problem in many low mobile devices)
h1.logo a {
display: block;
width: 300px;
height: 100px; /* valori de dimensiuni in functie de logo */
background: url(logo.png) no-repeat 0 0;
font: 0/0 a; /* truc sa facem textul ascuns */
/* ne asiguram ca resetam eventuale mosteniri nedorite */
border: 0;
text-shadow: 0;
@madalinignisca
madalinignisca / anonymous-wordpress.php
Created September 4, 2013 19:20
"anonymous" user faked on a real user. use something like Justin's members plugin to create a custom role or wait until I'll add more code to help with many important permissions. I'm putting this together for a project I'm doing (or done when you're reading this) to be able to post anonymous using a custom child theme based on p2. something lik…
<?php
function auto_login() {
if (!is_user_logged_in()) {
//determine WordPress user account to impersonate
$user_login = 'anonymous';
//get user's ID
$user = get_userdatabylogin($user_login);
$user_id = $user->ID;
@madalinignisca
madalinignisca / getContactForm7list
Created November 6, 2013 16:49
a function to get a list of Contact Form 7
<?php
function get_contact_forms() {
$allContactForms7 = array();
global $wpdb;
global $table_prefix;
$table_prefix = $wpdb->base_prefix;
$wpdb->tablename = $table_prefix . 'posts';
$contact_forms7 = $wpdb->get_results(
"
@madalinignisca
madalinignisca / gravityforms.css
Last active November 14, 2019 02:30
Gravity forms default styles and built in classes that can be used when creating forms with this plugin Maintained from http://www.gravityhelp.com/documentation/page/Design_and_Layout Use it to style Gravity Forms like a boss :)
/****************************************************************************
*** Gravity styles ***
****************************************************************************/
/*Form Body
contains the main form content*/
body .gform_wrapper .gform_body {border: 1px solid red}
/*Form List Container
unordered list used to structure all of the form elements*/
@madalinignisca
madalinignisca / robots.txt
Created November 19, 2013 14:08
Basic starting robots.txt for WordPress sites. Started from "Professional WordPress: Design and Development" book. You need to adapt it based on your custom permalinks!!!
Sitemap: http://www.example.com/sitemap.xml
User-agent: *
Disallow: /cgi-bin/
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /wp-content/plugins/
Disallow: /wp-content/cache/
Disallow: /wp-content/themes/
Disallow: /trackback/
@madalinignisca
madalinignisca / functions.php
Created February 23, 2014 10:55
WordPress themes function.php recommended things
<?php
// Support for thumbnails on proper media files - activates post thumbnails by default
add_post_type_support( 'attachment:audio', 'thumbnail' );
add_post_type_support( 'attachment:video', 'thumbnail' );
add_theme_support( 'post-thumbnails', array( 'post', 'attachment:audio', 'attachment:video' ) );