Frumph.NET

I'm in your site, touching your stuff.
  • Home
  • Contact
  • Downloads
    • Easel
  • Forum
Facebook Twitter Email Google+ pinterest YouTube RSS
May 2013
S M T W T F S
« Apr    
 1234
567891011
12131415161718
19202122232425
262728293031  

Recent Posts

  • You’re not going to believe this, but hey. Why not, right?
  • Use my custom default random avatars code in any theme.
  • Easel (theme) 3.3 Changelog
  • ComicPress 2.9.6 and WordPress 3.5 RSS fix for feedburner
  • ComicPress w/ Comic Easel (and Easel) and WordPress 3.5+ Bug
  • Easel 3.2
  • Redesign of theDreamlandChronicles.com (LIVE)
  • Easel 3.1
  • Theme Companion made obselete by Jetpack from Automattic, but in a good way.
  • Couple more child themes are available for Easel

Categories

  • Blog
    • Articles
    • BookOfPhilip
    • Dream Journal
    • News
    • Random Thoughts
  • ComicPress Child Themes
  • ComicPress Manager
  • Design
  • Guide
  • Information
  • Twitter
  • Uncategorized
  • WebComic
    • Rascal
  • WebComic Planet
  • Wordpress
    • Comic Easel
    • ComicPress
    • Easel
    • FAQ

You’re not going to believe this, but hey. Why not, right?

Apr27
by Philip M. Hofer (Frumph) on April 27, 2013 at 2:04 pm
Posted In: ComicPress, Wordpress

I am currently making a “ComicPress – Plugin” designed after the Comic Easel plugin, but uses the ComicPress coding scheme that will work in conjunction with ComicPress Manager. Which will allow you to use ComicPress on the Easel theme and integrate it into any theme on the WordPress repository.

It’s either that or I take the Easel theme and move ComicPress into it ;/ ONE OR THE OTHER! Which one would you rather have? .. seriously, need to know.

- Phil

Additionally do you think we should retire ComicPress altogether in favor of the better Comic Management Systems that are available?

24 Comments

Use my custom default random avatars code in any theme.

Apr19
by Philip M. Hofer (Frumph) on April 19, 2013 at 9:37 pm
Posted In: Wordpress

What this does is give your users who do *not* have gravatars from gravatar.com when they post comments, custom avatars that you create. It will pick one from inside the directory and constantly use it based on the end users email address that they use when making a comment.

This code will only replace “default” avatars, not ones that people have made at gravatar.com.

The ComicPress and Easel themes already have this, this is a code snippet for ‘other’ themes.

This is not code for someone who is completely new to PHP and WordPress coding.

Include this into your functions.php file of your main theme you use, not the child theme. You will have to add it again if your theme updates. This is meant for theme author’s to include it in their themes on updates.

function frumph_random_default_avatar_callback( $id_or_email = '' ) {
	if (!empty($id_or_email)) {
		$count = count($results = glob(get_stylesheet_directory() . '/images/avatars/*'));
		if ($count) { 
			$checknum = hexdec(substr(md5($id_or_email),0,5)) % $count;
			if ($count > 0) {
				$custom_avatar = basename($results[(int)$checknum]); 
				$replace_src_avatar = get_stylesheet_directory_uri().'/images/avatars/'.$custom_avatar;
				return $replace_src_avatar;
			}
		} else
			return get_option('avatar_default');
	} else
		return get_option('avatar_default');
}

THEN, you need to modify your get_avatar call in your theme (if your theme has it), this code is if your theme HAS a call to the get_avatar function.

What you do is you search for the function ‘get_avatar’ within the theme you are using, for example the thematic theme in the library/extensions/ has a file called ‘comments-extensions’ inside of it and the line with get_avatar looks like this:

$avatar = str_replace( "class='avatar", "class='photo avatar", get_avatar( $avatar_email, $avatar_size ) );

You want to modify the get_avatar function in it, the 3rd position is the the reference to the ‘default’ image, right after size, you will pass the email of the commenter to the function.

$avatar = str_replace( "class='avatar", "class='photo avatar", get_avatar( $avatar_email, $avatar_size, frumph_random_default_avatar_callback($avatar_email) ) );

In the twentytwelve theme, it’s in the content*.php files, looks something like this:

<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 68 ) ); ?>

You modify it to add the 3rd argument which changes the default image that it uses, with my code you also pass the email of the commenter in the function.

<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 68 ), frumph_random_default_avatar_callback(get_the_author_meta('user_email')) ); ?>

THEN
Add your images into the theme (or child theme’s) images/avatars/ directory so wp-content/themes/mychildtheme/images/avatars/ directory.

The reason I use get_stylesheet_directory is so that the images are retained in the child theme and if the child theme doesn’t exist the end user can put them in their main theme, but checks child theme first.

- Phil

└ Tags: code snippet
 Comment 

Easel (theme) 3.3 Changelog

Apr10
by Philip M. Hofer (Frumph) on April 10, 2013 at 8:06 pm
Posted In: Comic Easel, Wordpress
  • 1. Removed extra code inside the index.php file and fixed the pre_get_posts in the functions.php to associate the MAIN QUERY ONLY $query-> properly for posts per page.
  • Basically it removes an extra loop which wasn’t needed.

  • 2 & 3. removed the use of the function easel_display_post() – now using get_template_part(‘content’ ref: see format types (content.php) – added format types, which you can ‘skin’ the post area for the format type that you want to look differently for that particular format
  • content-aside.php content.php content-comic.php content-page.php   basically each ‘content type’ has their own php file (which is basically html), this will allow you to modify those ‘post areas’ display look and feel how you want them to in your child theme… basically copy the content- type file over to the child theme and hack away.  You can also create other ‘content’ types which are commented out in the functions.php like for images and video’s etc if you want specific looks for your post areas for whatever content type you want.

  • 4. rewrote the functions.php to stay with the guidelines of the theme review team as well as implement for post formats
  • n/t

  • 5. revamped how the featured image thumbnail for regular posts displays
  • IN the post info area, to the left of the title, the thumbnail will now display all mini like, instead of above everything, looks keen.

  • 6. revamped the display of the .post-info area of posts in the default style-default.css file
  • in the default style I added some ‘look’ to the post info (the header of  each post) to denote it’s difference from the rest of the post.

  • 7. added opengraph information for making a thumbnail for youtube video’s
  • opengraph = facebook – google, etc.

  • 8. css element #column is now #content to stay correctly in tune with other themes
  • This one is very important to CSS skinners, #column no longer exists and it is now #content, so find-replace inside of your CSS file if you used it. This also paved the way to allow the use of Jetpack’s Infinite scrolling. Which allows people to keep scrolling down the page and new posts will pop up. (along with the post formats change)

    NOTE edit the style.css, search for .post-image

    .post-content .post-image {
    	float: left;
    	display: inline-block;
    	padding: 3px 3px 0;
    	border: solid 1px #ccc;
    	margin: 4px;
    }
    
    .post-content .post-image img {
    	width: 100px;
    	height: auto;
    }
    

    Fixes the issue with 3.3 with the post image in the title

    IF you have layout-head.php in your child theme, make sure to change the id=”column” to id=”content” inside of that .php file

    └ Tags: Changelog
    17 Comments

    ComicPress 2.9.6 and WordPress 3.5 RSS fix for feedburner

    Dec17
    by Philip M. Hofer (Frumph) on December 17, 2012 at 6:46 am
    Posted In: Blog

    This will require some editing of your wp-content/themes/comicpress/functions/syndication.php file

    Open up that file on your hosting and replace it with the code available here:

    https://github.com/Frumph/comicpress/blob/master/functions/syndication.php

    ^ the github repo is where I store the latest of every edit I make, bug fixes and what not

    If you are logged into github you can find a “zip” button to download the latest full master copy at http://github.com/Frumph/comicpress

    Once you are done replacing that bit of code, you edit a post, save it which then updates your feed (clears your feed cache) then go to feedburner and click the resync button in your admin panel for feedburner

    - Phil

    NOTE: For older ComicPress versions, just replace this portion of the syndication.php file:

    if (!function_exists('comicpress_insert_comic_feed')) {
    	function comicpress_insert_comic_feed($content) {
    		global $wp_query, $post;
    		$category = get_the_category($post->ID);
    		if (comicpress_in_comic_category($category[0]->cat_ID)) {
    			$content = comicpress_comic_feed().$content;
    		}
    		return apply_filters('comicpress_insert_comic_feed', $content);
    	}
    }
    
    add_filter('the_content_feed','comicpress_insert_comic_feed');
    add_filter('the_excerpt_rss','comicpress_insert_comic_feed');
    



    For ComicPress 2.8 open the syndication.php file and replace this:

    //Insert the comic image into the RSS feed
    function comicpress_comic_feed() {
    global $post, $comicpress_options; ?>
    <p><a href="<?php the_permalink() ?>"><?php echo comicpress_display_comic_image('rss,comic',$comicpress_options['enable_post_thumbnail_rss']); ?></a></p><?php
    }
    

    With this:

    //Insert the comic image into the RSS feed
    function comicpress_comic_feed() {
    global $post, $comicpress_options; ?>
    return '<p><a href="'.get_permalink().'">'.comicpress_display_comic_image('rss,comic',$comicpress_options['enable_post_thumbnail_rss']).'</a></p>';
    }
    

    Again what you’re doing is ‘returning’ info instead of echo’ing it out.
    P.S. change the add_action for the_content to the_content_feed and the_excerpt_rss like the top example, just not the function name after it



    For WAYYYY OLD Comicpress’

       echo "<p><a href=\"";
        the_permalink();
        echo "\"><img src=\"$siteurl/$filename\" border=\"0\" alt=\"Cartoon 
    thumbnail - ";
            the_title();
            echo " - CLICK for full cartoon\" /></a></p>";
    

    replace that section with this line (all on one line):

    return  '<p><a href="'.get_permalink().'"><img 
    src="'.$siteurl.'/'.$filename.'" border="0" alt="Cartoon Thumbnail - 
    '.get_the_title().' - Click for FULL Cartoon." /></a></p>';
    

    The idea is to remove the ECHO’s and make it all RETURN

    For ComicPress 2.5:
    in the functions.php search for this:

    function comic_feed() {
      echo "<p><a href=\"";
      the_permalink();
      echo "\"><img src=\"";
      echo get_comic_url('rss');
      echo "\" border=\"0\" alt=\"";
      echo the_title();
      echo "\" /></a></p>";
    } 
    

    replace it with this:

    function comic_feed() {
      return '<p><a href="'.get_permalink().'" title="'.get_the_title().'"><img src="'.get_comic_url('rss').'" border="0" alt="'.get_the_title().'" title="'.get_the_title().'"></a></p>';
    } 
    
    28 Comments

    ComicPress w/ Comic Easel (and Easel) and WordPress 3.5+ Bug

    Dec12
    by Philip M. Hofer (Frumph) on December 12, 2012 at 9:28 pm
    Posted In: Comic Easel, ComicPress, Easel

    Found a bug, but it’s a simple one.

    The Symptom:  The archive list of posts for categories or terms looks funkey and shows years and no other info with a weird title

    The Cause: a template file in the theme’s directory is trying to be used instead of the main archive.php file which is supposed to be used, mainly when comic easel is being used in the comicpress theme

    The archive templates that come with ComicPress when you’re using Comic Easel *with* ComicPress as a theme need adjusting their filenames.

    The filenames in question are all of the files in the themes directory that start with archive-*.php  (the * means anything after that)  for exampl;e, the main culprit is archive-comic.php … archive.php is fine, it’s just the ones with the dash after it.

    So to fix this, you basically just FTP into your theme directory for easel or comicpress and rename the template files to be template-archive-*.php  .. example archive-comic.php would turn into template-archive-comic.php and that would fix it from looking at archive-comic.php as the archive page for the comic post type

    - Phil

    2 Comments
    • Page 1 of 28
    • 1
    • 2
    • 3
    • 4
    • 5
    • »
    • Last »
    Frumph.NET
    Proudly powered by WordPress Theme: Easel - Pro.
    • Home
    • CP2CE
    • Downloads

    ©2008-2013 Frumph.NET | Powered by WordPress with Easel | Subscribe: RSS | Back to Top ↑