Digital Raindrops
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Free Twenty Eleven Photo Blogging Child themeAnyone that downloaded the theme, I have updated the files to include a 120px by 120px Logo, see the links above.
I have changed the child themes functions.php file as well to use the pluggable function from the parent twenty eleven folder, twentyeleven_setup().
This allowed me to removed unwanted image sizes and a lot of the parents defaults like the images, and use the headers for managing and uploading the Logo’s.
Regards
David
Forum: Themes and Templates
In reply to: twenty ten child themeTry this, my function with the one from esmi inside
<?php /* This function will run after the parents functions.php */ add_action( 'after_setup_theme', 'post_theme_setup' ); if ( !function_exists( 'post_theme_setup' ) ): function post_theme_setup() { /* Code goes here! */ add_filter( 'twentyten_header_image_width', 'my_header_width' ); add_filter( 'twentyten_header_image_height', 'my_header_height' ); function my_header_width($width) { $width = 980; return $width; } function my_header_height($height) { $height = 224; return $height; } } endif;HTH
David
Forum: Themes and Templates
In reply to: Customise posts within a categoryHi,
The theme supports custom menus, do you need the news mixed in with the mixtapes, it looks like you are only using a single category?If not then create a top level category assign all the mix tapes to that category.
Make the home page the parent category and leave the news on its own menu item.
I think you are already using custom menus, if not go to Admin > Appearance > Menus
Create two menus and assign them in the Theme Locations box
Example:HTH
David
Forum: Themes and Templates
In reply to: Creation of XXX*288 and XXX*300 images by Twenty Eleven themeHi,
I have just had another look at the twenty eleven functions.phpThe good news is the function ‘twentyeleven_setup’ is pluggable, dumb thing is I wrote about it back in April.
if ( ! function_exists( 'twentyeleven_setup' ) ): function twentyeleven_setup() { } endif;That means we can just copy the whole function from the parent to the child, we do not rename it, the childs function will run and the parents will not!
Copy lines 47 – 210 from the parent
From/** * Tell WordPress to run twentyeleven_setup() when the 'after_setup_theme' hook is run. */ add_action( 'after_setup_theme', 'twentyeleven_setup' );Down to the endif;
endif; // twentyeleven_setupThat function is now ours to change whatever we want!
That has opened up my thinking!
Glad I answered this one!
David
Forum: Themes and Templates
In reply to: Creation of XXX*288 and XXX*300 images by Twenty Eleven themeI have just tested the code I posted and cannot get it to work, it will not recognise the global, so I am stumped!
With the child themes functions.php you create it like the style.css and do not copy it across.
Sample child themes functions.php
<?php /** Tell WordPress to run post_theme_setup() * when the 'after_setup_theme' hook is run. */ add_action( 'after_setup_theme', 'post_theme_setup' ); if ( !function_exists( 'post_theme_setup' ) ): function post_theme_setup() { } endif;HTH
David
Forum: Themes and Templates
In reply to: Creation of XXX*288 and XXX*300 images by Twenty Eleven themeTo answer the topic have a look at this plugin, read the information and test if possible.
—————————————————————
The additional image size is set in the themes functions.php// Used for large feature (header) images. add_image_size( 'large-feature', $custom_header_support['width'],$custom_header_support['height'], true ); // Used for featured posts if a large-feature doesn't exist. add_image_size( 'small-feature', 500, 300 );Do not edit any of the default themes files, if you are doing any modifications use a child theme.
Why is there is no core function to remove_image_size( ‘small-feature’ );
UNTESTED CODE:
So in a child themes functions.php/** * Unset unwanted image sizes in child theme */ function dr_remove_image_size( $name ) { global $_wp_additional_image_sizes; unset( $_wp_additional_image_sizes[$name] ); } function dr_unset_images(){ dr_remove_image_size( 'small-feature' ); /* Not using the header images */ dr_remove_image_size( 'large-feature' ); } add_action( 'after_setup_theme', 'dr_unset_images' );I would just live with the images unless I had thousands of posts!
HTH
David
Forum: Themes and Templates
In reply to: probelms with banner imagesHi,
You can do it anyway you want, it will mean that you will have to update it as you add more default headers.I would say not to
hard codethe url, what if you want to have a local copy, share your theme, move hosting then you will have to edit the files.I have adjusted your code and added a variable to hold the url to the headers folder, and changed the links.
/** This will get the url of the current website * and path to the headers folder */ $url = get_stylesheet_directory_uri() .'/images/headers/';Have a look at setting up a local WordPress install or environment to develop and test your changes, then ftp them to your website.
HTH
David
Forum: Themes and Templates
In reply to: twenty ten child themeHi,
If you are changing the header size in a child theme then it needs to be wrapped in a ‘post_theme_setup’ function, called with the ‘after_setup_theme’ hook!WordPress will then load the childs functions.php, the parents functions.php and lastly the childs ‘after_setup_theme’ function hook.
add_action( 'after_setup_theme', 'post_theme_setup' ); if ( !function_exists( 'post_theme_setup' ) ): function post_theme_setup() { /* Code goes here! */ } endif;The images will not be re-sized retrospectivly, the parents headers will always be smaller than the new ones, so you will upload new images.
I will leave it back with esmi!
HTH
David
Forum: Themes and Templates
In reply to: size of main content areaThe theme is responsive so do everything by percentages and not fixed width, as the browser is re-sized and the content is changed by percentage everything is stacked, re-size the browser to a mobile width to see what I mean.
If we have more info on why you need to use a fixed width we might be able to help more.
Please decrease the Margin…
Note: if you do this you must also adjust:
#primary { float: left; margin: 0 -26.4% 0 0; width: 100%; } #content { margin: 0 34% 0 7.6%; width: 58.4%; }Regards
David
Forum: Fixing WordPress
In reply to: Menu_id and menu_class will not work properly with wp_nav_menu();@shahidkarimi,
Why are you asking questions in a topic from 8 months ago, if you have a question start a new topic!There have been new releases in the last eight months with many issues resolved, so it is likly not a problem now!
David
Forum: Themes and Templates
In reply to: Page content wont stay in divThe content goes in one strait line to the right and does not break properly when it hits the set width of the div
As it is the content then it is likeky to be unclosed html tags in the post content, or content pasted from MS Word
Test:
Create a new post, get five paragraphs of Lorem Ipsum save and view, if this does not overflow, then it is the other posts content that is the problem.EDIT:
Just found this topic from today about the line height πHTH
David
Forum: Themes and Templates
In reply to: probelms with banner imagesHi Guys,
'url' => '%s/The
%sis returning the parents directory and not the child themes directory, that is why the code is not working.You need to upload a second set of smaller banner thumbnails that are 230 x 66.
If you want to use this code you must do as esmi said, image names should be lowercase, no spaces, and every header must have a thumbnail
storm.png and storm-thumbnail.png
storm-chaser.png and storm-chaser-thumbnail.pngwidth can be altered to display a bigger thumbnail if you want, height should be proportional, just re-size the headers 230px wide and save as with the -thumbnail added!
Making the thumbnails takes a few minutes and makes all the difference.
Maybe I can help out here, have a look at this code:
http://pastebin.com/56X9mX9RFirst it will remove the parent themes images.
unregister_default_headersNext there is a nice little function I created:
- it will look in the child theme’s folder for /images/headers/
- loop through the files
- find images with -thumbnail like storm-thumbnail.png
- load the images into an array, path, thumbnail, name etc:
- name is first cased storm-chaser becomes Storm Chaser for the title
- Register the new headers
It is really nice because you only need to add the headers and thumbnails to the folder, you do not have to write the code to register them the function will do all that for you!
This would make a nice addition to your functions library!
HTH
David
Forum: Themes and Templates
In reply to: Changing and selling default WP Themes – legal/illegal?Read the license.txt file in the themes folder!
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.Are there any other warranties I should be aware of?
Images and assets you download from websites or pages the web and use in your custom theme, might be not be able to be included with your theme, always get images from a proper source and check the license.
Even if you pay for Royalty Free licensed button images from somewhere like istock, these you cannot include with your template files even in a free theme, without purchasing an extended license.
Then there are some you can include in your theme for free or paid download.
HTH
David
Forum: Themes and Templates
In reply to: Customise posts within a categoryIf you are using a cache plugin clear the cached pages.
Put a screen echo in both the files somewhere and see if they are loading!
If not review the code above!
<?php echo 'This is the category-news.php file!' ; ?><?php echo 'This is the post-news.php file!' ; ?>HTH
David
Forum: Themes and Templates
In reply to: Categories separated into different pages.Best advice is to try it!
do the categories listed in the menu bring to pages with just posts that are in that category?
Yes only posts from the category are returned to the screen.
Can you set these pages up with different page templates?
You would not need a page template unless there was something specific for that category, then you would find the category {slug} News would be news
Open category.php and save it as category-{slug}.php, make any category specific changes.
News Category page would then be category-news.php
EDITED:
But are these pages that can have different templates? (different headers on each one)
With a little code, this post extending the categories, has different headers per category and much more, the theme in the link you can get from here, that has eight different content layouts, between the two you could do what you want.
Note: the theme in the link and my website are both twenty eleven child themes!
HTH
David