Skip to content

Instantly share code, notes, and snippets.

View andornagy's full-sized avatar

Andor Nagy andornagy

View GitHub Profile
<?php get_header(); ?>
<div id="warp">
<div class="main container <?php echo get_option('acer_layout') ?>">
<?php if ( have_posts() ) { while ( have_posts() ) { the_post(); ?>
<!-- 6 column grid -->
<article id="post-<?php the_ID(); ?>" <?php post_class(array('entry', 'grid-6')); ?> <?php get_category_by_slug( 'slug' ) ?>>
<!-- spans 6 columns -->
<?php
function random_post() {
global $wpdb;
$arr = $wpdb->get_results("SELECT ID FROM wp_posts WHERE post_type='post' and post_status='publish'
","ARRAY_A");
$curr_id = get_the_ID();
<?php
function render_stats($post_id) {
$args = array(
'days'=>-1,
'limit'=>-1,
'post_id'=>$post_id
);
$result = stats_get_csv('postviews', $args);
<?php // ignore this
function insert_after_paragraph( $insertion, $paragraph_id, $content ) {
$closing_p = '</p>';
$paragraphs = explode( $closing_p, $content );
foreach ($paragraphs as $index => $paragraph) {
if ( trim( $paragraph ) ) {
$paragraphs[$index] .= $closing_p;
}
@andornagy
andornagy / Simple-jQuery-Accordion.markdown
Last active August 29, 2015 13:57
A Pen by Andor Nagy.
Current demo can be seen here http://wp.andornagy.info/
2.0 - Added 3 New color Shames : Red,Blue and Green
- Added Return to Top Button
- Added the feature to reposition thumbnails based on their sizes. If the thumbnail is large, then above post title, else below.
- Removed Featured Image Brightness Trensitions
- Rmeoved Padding from Content area so it now alligns on both side with the featured image
- Fixed Image logo and Text Title margins and paddings
- Changed the Mobile Navigation
- Chnaged font from PT Sans', sans-serif; to Georgia serif;
<?php
add_filter('wp_nav_menu_items','add_custom_in_menu', 10, 2);
function add_custom_in_menu( $items, $args ) {
if( $args->theme_location == 'primary') {
$items .= '<-- Your content here -->';
}
return $items;
/*
* Animation configurations ( duration and fill mode )
*/
.animated {
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
#accordion {
margin:0 auto;
width:400px;}
ul {
margin:0;
padding:0;
}
ul li {
/* CSS Document */
/*
* IMporting the font
*/
@import url(http://fonts.googleapis.com/css?family=Roboto+Slab|Roboto);
/*
* General styling
*/