Skip to content

Instantly share code, notes, and snippets.

View amyinorbit's full-sized avatar

Amy Parent amyinorbit

View GitHub Profile
@amyinorbit
amyinorbit / functions.php
Last active January 2, 2016 14:19
Crée un fichier search.json à la racine d'un blog wordpress
add_action( 'transition_post_status', 'a_new_post', 10, 3 );
function a_new_post( $new_status, $old_status, $post )
{
if ( 'publish' !== $new_status or 'publish' === $old_status )
{
return;
}
$postsArray = Array(); // un tableau vide
@amyinorbit
amyinorbit / wp-json-index.php
Created January 8, 2014 11:49
Sample (probably not right) json index generation code for wordpress
<?php
$postsArray = Array(); // un tableau vide
while ( have_posts() ) : the_post(); // on boucle avec tous les articles
$currentPost = Array(); // un tableau vide pour l'article en cours
$currentPost["title"] = the_title(); // on ajoute le titre
$currentPost["url"] = the_permalink(); // l'url
array_push($postsArray, $currentPost); // et on ajoute le tableau de l'article au tableau global
@amyinorbit
amyinorbit / vimeo_embed.html
Created June 28, 2012 20:16
Video posting on London Framewodk
<div class="video-container">
<iframe src="http://player.vimeo.com/video/41283932" width="500" height="281" frameborder="0">
</iframe>
</div>
<!-- note that width and height parameters are useless here because mian CSS sets them dynamically after page loading. They are however required to be valid HTML, according to the W3C specification -->
@amyinorbit
amyinorbit / example.css
Created June 26, 2012 10:44
Link CSS management
/* définition du style des liens "normaux (non survolés)*/
a {
color: #666666;
background-color: transparent;
}
/* maintenant, en ajoutant ":hover", on définit le style au survol */
a:hover {
color: #FF00000; /* la couleur des liens survolés */