Another good day!
Again, this time i will show you some extreme modification to make your Arthemia theme by ColorLabs & Company more powerful dan of course more pretty.
What we will do right now is to add some slider into front page of this theme. To make your imagination working, please watch this video:
16-Apr-13 11-55-18 AM from shinjing on Vimeo.
Ok, this modification should be simple if you ever learn a little bit about HTML (so you don’t have to be an expert 🙂 ). First, download this JQuery bundle from here, then here the list of files you have to prepare:
- index.php
- theme-js.php
- style.css
Ok, so it will be just 3 files affected for this modification, and before you do this modification make sure if you already have a backup files (since this modification affecting file index.php, any failure you made will make your site down).
Part 1
I decided to divide this tutorial into several chapter to make it easier to understand. Ok, this first part will explain you how to modify the index.php. Make sure if you edit this file via FTP (you can redo if you make a mistake), and if you never work with this stuff or never explore the Arthemia theme folder, you can go to directory: root → wp-content → themes → arthemia-premium
Once you get in that folder, you will find a file named index.php, open that file and you should found this code:
<?php get_header(); ?> <?php //Get value from Admin Panel $cp_categories = get_categories('hide_empty=0'); $status1 = get_option( "colabs_preventHeadline" ); if ( $status1 != "No" ) { $ar_headline = get_option( "colabs_headline" ); $ar_featured = get_option( "colabs_featured" ); } ?> <div id="bottom" class="clearfloat"> <div class="wrapper <?php if(get_option('colabs_layout_settings')=='two-col-right'){echo 'right';}else{?>left<?php }?>"> <?php if(!is_paged()) { ?> <div id="front-list"> <?php $latest_query = new WP_Query(array( 'category__not_in' => array($ar_headline,$ar_featured), 'showposts' => 1, )); ?> <?php while ($latest_query->have_posts()) : $latest_query->the_post(); ?> <?php global $ar_ID; global $post; $ar_ID[] = $post->ID; ?> <div class="clearfloat"> <h3 class="cat_title"><?php the_category(', '); ?> »</h3> <h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2> <?php colabs_post_meta(); ?> <?php $latest_thumb=get_option('colabs_latest_post_thumb'); if($latest_thumb!='No'){ $width = get_option ( "colabs_thumbWidth_LatestPost" ); $height = get_option ( "colabs_thumbHeight_LatestPost" ); if ( $width == 0 ) { $width = 150; } if ( $height == 0 ) { $height = 150; } colabs_pp('width='.$width.'&height='.$height.'&size=medium-thumb&play=true&wrapper_class=left&link=img'); } ?> <?php the_content(__('Read the full story »','colabsthemes')); ?> </div> <?php endwhile; ?> <?php wp_reset_postdata(); ?> </div><!--/#front-list--> <?php } ?> <?php add_filter('post_limits', 'my_post_limit'); ?> <?php global $myOffset; $myOffset = 1; $temp = $wp_query; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query(array( 'paged' => $paged, 'offset' => $myOffset, 'category__not_in' => array($ar_headline,$ar_featured), 'post__not_in' => get_option( 'sticky_posts' ), 'ignore_sticky_posts' => 1, )); ?> <?php $column = get_option ( "colabs_status_Column" ); if ( $column != "one" ) { ?> <div id="paged-list"> <?php if (have_posts()) : ?> <?php $i = 1; ?> <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <?php global $ar_ID; global $post; $ar_ID[] = $post->ID; ?> <?php if( $odd = $i%2 ) { echo '<div class="clearfloat">'; } ?> <div class="tanbox <?php if( $odd = $i%2 ) { echo 'left'; } else { echo 'right'; } ?>"> <h3 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> <?php colabs_post_meta(); $width = get_option ( "colabs_thumbWidth_Column" ); $height = get_option ( "colabs_thumbHeight_Column" ); if ( $width == 0 ) { $width = 80; } if ( $height == 0 ) { $height = 80; } colabs_pp('width='.$width.'&height='.$height.'&size=small-thumb&play=true&wrapper_class=left&link=img'); ?>
After you found that code, edit it become:
<?php get_header(); ?> <?php //Get value from Admin Panel $cp_categories = get_categories('hide_empty=0'); $status1 = get_option( "colabs_preventHeadline" ); if ( $status1 != "No" ) { $ar_headline = get_option( "colabs_headline" ); $ar_featured = get_option( "colabs_featured" ); } ?> <div id="bottom" class="clearfloat"> <div class="wrapper <?php if(get_option('colabs_layout_settings')=='two-col-right'){echo 'right';}else{?>left<?php }?>"> <?php add_filter('post_limits', 'my_post_limit'); ?> <?php global $myOffset; $temp = $wp_query; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query(array( 'paged' => $paged, 'category__not_in' => array($ar_headline,$ar_featured), 'post__not_in' => get_option( 'sticky_posts' ), 'ignore_sticky_posts' => 1, )); ?> <?php $column = get_option ( "colabs_status_Column" ); if ( $column != "one" ) { ?> <div id="paged-list"> <?php if (have_posts()) : ?> <?php $i = 1; ?> <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <?php global $ar_ID; global $post; $ar_ID[] = $post->ID; ?> <?php if( $odd = $i%2 ) { echo '<div class="clearfloat">'; } ?> <div class="tanbox <?php if( $odd = $i%2 ) { echo 'left'; } else { echo 'right'; } ?>"> <h3 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> <?php colabs_post_meta(); ?> <ul class='gallery-slide'> <?php $attachments = get_children(array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID')); foreach($attachments as $att_id => $attachment) { $full_img_url = wp_get_attachment_url($attachment->ID); $split_pos = strpos($full_img_url, 'wp-content'); $split_len = (strlen($full_img_url) - $split_pos); $abs_img_url = substr($full_img_url, $split_pos, $split_len); $full_info = @getimagesize(ABSPATH.$abs_img_url); ?> <li> <a href="<?php echo $full_img_url; ?>" title="<?php echo $attachment->post_title; ?>" target="_blank"><img src="<?php bloginfo('stylesheet_directory'); ?>/functions/timthumb.php?src=<?php echo $full_img_url; ?>&w=273&h=150&a=t" /></a> </li> <?php } ?> </ul>
Ok, your modification on this file already done. And i will explain some code i use on this modification. At the modification above, the code i made is to call every images attached to the post (attached images means the images you upload, not external link, video thumbnail, or an image added via gallery).
The code is like this one (you can reuse this code if you want):
<?php $attachments = get_children(array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID')); foreach($attachments as $att_id => $attachment) { $full_img_url = wp_get_attachment_url($attachment->ID); $split_pos = strpos($full_img_url, 'wp-content'); $split_len = (strlen($full_img_url) - $split_pos); $abs_img_url = substr($full_img_url, $split_pos, $split_len); $full_info = @getimagesize(ABSPATH.$abs_img_url); ?> <div class="WallSizesHolder"> <div class="WallSizesThumbHolder"> <a href="<?php echo $full_img_url; ?>" title="<?php echo $attachment->post_title; ?>" target="_blank"><img src="<?php bloginfo('stylesheet_directory'); ?>/thumb.php?src=<?php echo $full_img_url; ?>&w=92&h=69&zc=1" /></a> </div> <p><?php echo $full_info[0].'x'.$full_info[1]; ?></p> </div> <?php } ?>
The code above is calling for timthumb file which is very important on Arthemia theme to render/produce the thumbnail.
<?php bloginfo('stylesheet_directory'); ?>/thumb.php
That code is telling the functions about where is the timthumb file located. The blog info will tell the functions about yours site url, then you can type the location (please check the modification code above for details).
Part 2
Next Part is configuring the code behind the slider, make sure if you already download the JQuery files from link at the top of this article.
After download those files, you can upload it into directory: root → wp-content → themes → arthemia-premium → includes → js → test (this test folder is not exist, then create it).
After upload the file into folder test, go back into folder includes then open a file named theme-js.php, edit the file and you will find a code like this one:
if (is_home()) { wp_enqueue_script( 'jquery.jcarousel.pack', trailingslashit( get_template_directory_uri() ) .'includes/js/jquery.jcarousel.pack.js', array( 'jquery' ) ); wp_enqueue_script( 'js-menu', trailingslashit( get_template_directory_uri() ) .'includes/js/js-menu.js', array( 'jquery', 'jquery.jcarousel.pack' ) );
Edit that code become:
if (is_home()) { wp_enqueue_script( 'jquery.jcarousel.pack', trailingslashit( get_template_directory_uri() ) .'includes/js/jquery.jcarousel.pack.js', array( 'jquery' ) ); wp_enqueue_script( 'js-menu', trailingslashit( get_template_directory_uri() ) .'includes/js/js-menu.js', array( 'jquery', 'jquery.jcarousel.pack' ) ); wp_enqueue_script( 'jquery', trailingslashit( get_template_directory_uri() ) . 'includes/js/test/jquery.js', array('jquery') ); wp_enqueue_script( 'scripts', trailingslashit( get_template_directory_uri() ) . 'includes/js/test/scripts.js', array('jquery') ); wp_enqueue_script( 'plugin', trailingslashit( get_template_directory_uri() ) . 'includes/js/test/plugins.js', array('jquery') );
If you already reach this step, then you can open your site to check whether the modification is working or not (the modification right now might be not good enough, at the part 3 you will learn how to modify the its styling).
Part 3
This is the last part of this tutorial, if you do exactly the same as mentioned above then congratulations!
Ok, what you have to modify is a file named style.css. You can copy these code below and put it into the end of this file, simple isn’t it?
/* Gallery slides*/ .outer-gallery-slide { padding-bottom: 10px; border-bottom: 5px solid #DDD; } .gallery-slide li { float: left; list-style: none; }
Done!
Miscellaneous
This part is the extra configuration about the slider, this slider JQuery is made by carouFredSel, give them a credit for making this great script.
If you notice, there is a file named script.js at the DropBox folder (JQuery files). This file is controlling all behavior that the slider have, to add some features into the slider, you can check out this url
Hello, Neat post. There is a problem with your site in web explorer, may check this? IE still is the market chief and a huge section of people will leave out your magnificent writing because of this problem.
Hi thanks for notifying me about the layout on IE, seems i should take a look for another themes
A person necessarily assist to make significantly posts
I’d state. This is the first time I frequented your web page and to this point? I amazed with the analysis you made to make this particular post extraordinary. Magnificent activity!
Whats up very nice blog!! Spent an interesting few
minutes looking about. I’m glad to seek out a lot of useful info right here in the post, we need work out more techniques in this regard, thank you for sharing. . . . . .
hi, actually this code sharing is for remind myself if someday i forgot how to do it 🙂 please enjoy browse my blog
This is a topic which is close to my heart.
.. Many thanks! Exactly where are your contact details though?
hi, you can send me an email to hexter991@gmail.com
There is definately a lot to learn about this subject.
I really like all of the points you have made.
hi thanks!
I used to be able to find good info from your
blog posts.
hi thanks!
Hi there, I would like to subscribe for this weblog to obtain latest updates, so where can
i do it please help.
hi, since my blog based on WordPress.com, then to subscribe my blog you will need to create a WordPress.com account first
Hi! I’ve been reading your web site for some time now and finally got the courage to go ahead and give you a hi from Leeds. Just wanted to mention keep up the good job!
hi thanks!
Some truly wonderful posts on this site, appreciate it for contribution.
I love your blog.. very nice colours & theme. Did you design this website yourself or did you hire someone to do it for
you? Plz respond as I’m looking to construct my own blog and would like to know where u got this from. many thanks
hi, i use a theme which is provided by WordPress, the theme name is Widely by http://www.themeskingdom.com/
Excellent blog here! Also your site loads up very fast! What
web host are you using? Can I get your link to your host?
I wish my website loaded up as quickly as yours lol
hi, my blog is based on WordPress.com (stored on WordPress.com, not a hosting company)
You touch on this a lot better than I ever could – probably why I do not have
a blog of my own.
I love your blog.. very nice colours & theme. Did you make this website yourself or did you hire someone to do it
for you? Plz respond as I’m looking to design my own blog and would like to know where u got this from. thanks
hi, i use a theme which is provided by WordPress, the theme name is Widely by http://www.themeskingdom.com/
Thank you, I’ve recently been searching for information approximately this subject for a while and yours is the best I have came upon till now. But, what in regards to the bottom line? Are you certain in regards to the supply?
Amazing! This blog looks just like my old one! It’s on a entirely different subject but it has pretty much the same layout and design. Outstanding choice of colours!
hi, thanks!
Wonderful blog! I found it while searching on Yahoo News.
Do you have any tips on how to get listed in Yahoo News?
I’ve been trying for a while but I never seem to get there! Thanks
hi, i even don’t know if my blog was listed on Yahoo News. Maybe it is the SEO from the wordpress
I don’t know whether it’s just me or if perhaps everybody else
experiencing problems with your blog. It appears as if some of the content in your content are running
off the screen. Can somebody else please provide feedback and let me know if this is happening to them as well?
This might be a issue with my browser because
I’ve had this happen previously. Thanks
My partner and I stumbled over here from a different page and thought I might as
well check things out. I like what I see so now i am following you.
Look forward to checking out your web page for a second time.
i am following your blog regularly and got great information. i really like the tips you have given. thanks a lot for sharing. will be referring a lot of friends about this.
I just want to tell you that I am very new to blogging and actually loved your web site. More than likely I’m going to bookmark your website . You definitely come with outstanding articles and reviews. Bless you for sharing your website.
Looks as though the cat’s out of the bag on this… I will have a read and see whats coming up….
Cool blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple tweeks would really
make my blog jump out. Please let me know where you got your
design. Cheers
Hi,
My theme name is Widely, by Theme Kingdom
Thankfulness to my father who told me about
this website, this website is in fact amazing.
magnificent issues altogether, you just won a new reader.
What might you recommend about your submit that you just made
a few days in the past? Any sure?
Dont rekon I get all this 2 b purfectly honest. Myt have to look other place 2 get
it.
When someone writes an post he/she keeps the thought of a user
in his/her brain that how a user can understand it. So that’s why this piece of writing is outstdanding. Thanks!
I’m questioning at what age we start to become wiser and pay no attention to all this nonsense.
I’m not trying to be a pest, I think you can write better content than this. More content would be a start.
Amazing issues here. I’m very satisfied to peer your article. Thank you a lot and I’m looking forward to contact you.
Will you please drop me a mail?
I’ve read that many comments on this matter that I couldn’t be more
perplexed.
I’ve been trying to find a helpful article on this for months, and this has been a perfect help. I will be getting this shared on facebook for sure.
You touch on this much better than I myself could – which is
perhaps why I don’t have a successful blog.
I blog often and I truly appreciate your content.
Your article has truly peaked my interest.
I am going to take a note of your blog and keep checking for new information about once a week.
I opted in for your RSS feed as well.
Don’t mind perusing articles such as this on rainy days.
Oh I understand now! I thought that was an optional crazy addition.
Awesome issues here. I’m very glad to see your post. Thank you a lot and I am looking ahead to contact you. Will you kindly drop me a e-mail?
I am genuinely wasting all of my day so far reading all these posts.
However this is still more fruitful than yesterday!
. At least I’ll find out something new.
I am really thankful to the owner of this web site who has shared
this wonderful piece of writing at at this time.
Good read, especially poster #4 I think it was.
Worth taking note of.
Could do with some extra writing on this – any opinions as to what I might read or what websites I
might go to??
I’m really enjoying the design and layout of your website. It’s a very easy on the eyes which
makes it much more pleasant for me to come here and visit more often.
Did you hire out a designer to create your theme? Outstanding work!
thankyou!
for this theme i’m not hire any designer, it is a free theme provided by Themes Kingdom
Hi,
Interesting website, I find this webpage very informative and focused on topic.
BTW, I really like your layout of the website. Have a great day.
Good post! We are linking to this great article on our website.
Keep up the great writing.
Hi there! This is kind of off topic but I need some advice from an established
blog. Is it very hard to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about creating my
own but I’m not sure where to begin. Do you have any points or suggestions? Thank you
i can only compliment you for the good job you have been doing in this blog, congratulations and keep it coming.
hello there and thank you for your information – I’ve definitely picked up something new from right here. I did however expertise some technical points using this site, since I experienced to reload the site a lot of times previous to I could get it to load properly. I had been wondering if your web hosting is OK? Not that I am complaining, but sluggish loading instances times will sometimes affect your placement in google and could damage your high quality score if ads and marketing with Adwords. Well I’m adding this RSS to my email and can
look out for a lot more of your respective
fascinating content. Ensure that you update this again soon.
Hi there i am kavin, its my first occasion to commenting anyplace, when i read this article i thought i could also create comment due to this sensible
article.
nice to know you Kevin!
hope you enjoy my tutorials here
I think this is among the most significant information for
me. And i’m glad reading your article. But wanna remark on few general things, The web site style is great, the articles is really nice : D. Good job, cheers
I was very pleased to seek out this web-site.I wanted to thanks in your time for this glorious read!! I undoubtedly enjoying each little bit of it and I have you bookmarked to check out new stuff you weblog post.