Digital Raindrops
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Custom Post Type PaginationYou do not need the line:
$paged = (get_query_var('page')) ? get_query_var('page') : 0;If I am right WordPress will populate and return the $paged variable in the query, so you do not need to set it.
$args=array( 'post_type' => 'Nieuws', 'paged' => $paged, 'posts_per_page' => 2, 'order' => 'desc' ); $wp_query = new WP_Query($args);HTH
David
Forum: Themes and Templates
In reply to: Return doesn't put variable where it belongsget the path to an images folder inside my theme
To get files from within a child themes folder use
<?php /* Start include file by file path */ ?> $file_path = get_stylesheet_directory() . '/inc/meta-functions.php'; if( file_exists( $file_path ) ) include_once( $file_path ); <?php /* End include file by file path */ ?>To get images to display on a template page from within a parent themes folder
<?php /* Start get image by url */ ?> <?php $img_url = get_template_directory_uri() . '/images/my-image.png'; ?> <img src="<?php echo $img_url; ?>" alt="" title="" width="" height="" /> <?php /* End get image by url */ ?>Parent Themes Folder
get_template_directory()
get_template_directory_uri()If we are using a child theme then TEMPLATEPATH becomes STYLESHEETPATH
Child Themes Folder
get_stylesheet_directory()
get_stylesheet_directory_uri()These are very handy WordPress function wrappers, which in turn call get_bloginfo() with the correct arguments, returning the path or url.
HTH
David
When I add a custom menu
The home menu item is set in functions.php so you can remove the menu item by removing the filter and then use a URL menu item to point to the home page.
From Twenty Eleven functions.php
/** * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. */ function twentyeleven_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'twentyeleven_page_menu_args' );Assuming you using the custom menu css-classes?
If so then in the child themes function.php
/** START function will remove the parent filter */ add_action( 'after_setup_theme', 'child_remove_filters' ); if ( !function_exists( 'child_remove_filters' ) ): function child_remove_filters() { remove_filter( 'wp_page_menu_args', 'twentyeleven_page_menu_args' ); } endif; /** END function will remove the parent filter */Now create a URL menu item with a link to the home page, and add the Menu Item css-class
HTH
David
Forum: Fixing WordPress
In reply to: Where can I find the function get_content?Hi,
I tested this in twenty eleven and it works fine, added to style.css.singular img { border: 1px solid #E0E0E0; box-shadow: 1px 1px 2px #E0E0E0; padding: 5px; }HTH
David
Forum: Themes and Templates
In reply to: Is there category.php functionality for custom post types?You would create a template page based on your themes code.
Example: Testimonials Custom Post Type, this examples does not have the navigation points but it is commented.
HTH
David
Forum: Themes and Templates
In reply to: wp_dropdown_categoriesHi Josh,
I think you would create your own category dropdown and use get_categories() wich has the ‘include’ argument.I use categories dropdown in this child theme, you can get an example in the download, /inc/pop-meta-functions.php code, line 64 you would need to add the ‘include’, the dropdown is lines 90-103
Thinking a little “outside the box” if the theme supports custom menus create a custom menu and add the categories, in code call the menu with wp_get_nav_menu_items() adding these into a select dropdown, much cleaner and loads more control.
HTH
David
Forum: Themes and Templates
In reply to: Retrieving the First Image in a postHave a read of this topic, it gets all the images, one of the replies gets the first, my solution gets all.
HTH
David
Forum: Themes and Templates
In reply to: Brunelleschi 1.4.2 Header Font IssueHi,
If you have a smaller logo then you can overlay it on a header to keep perspective, after reading this I wrote a post on logo’s and header images.HTH
David
Forum: Themes and Templates
In reply to: Brunelleschi 1.4.2 Header Font IssueReduce the height as suggested to 88, then you would overlay / paste your logo onto a transparent png image 1000 * 88, and upload this to Admin > Headers
That would give you a proportional header and allow any background to show
—————————————————-
| Logo | Transparent area
—————————————————-
HTH
David
Forum: Themes and Templates
In reply to: Brunelleschi Header SizeHave a look at this post from Esmi, this is how you would do it in twenty eleven.
But you would need to change the filtered function name
function my_header_image_height($height) { return 150; } add_filter( 'brunelleschi_header_image_height', 'my_header_image_height');HTH
David
For the 1140 Grid then something like this:
http://pastebin.com/J2aaYcMTClass name changed for 1140 styles:
<?php $column = $counter % 4; ?> <?php $class = ( $column ) ? '<div class="threecol">' : '<div class="threecol last">'; <?php if( $column == 1 ): // Open the Row?>NOTE
This is not tested code so you need to test it!
If you find any undocumented features (bugs) please update the pastbin and post a link back for others who might need the example!HTH
David
Forum: Themes and Templates
In reply to: [Theme: Twenty Eleven] Creating a horizontal dropdown submenuA menu walker returns the menu as an array, and you can then add classes, change output etc:
This post here add the menu description to the menu items as an example.
The walker I had to write was for the sub menu, as category menu classes do not add ancestor classes, so I had to find the ancestors, parents and siblings
So that is what you would be looking at really, getting the related menu items via a walker and showing them on a sub menu, I have the code for categories but not custom menu items.
If it is your own website for $16 there is UberMenu MegaMenu
Or these from Design Chemical
Regards
David
Forum: Themes and Templates
In reply to: [Twenty Eleven] Twenty Eleven Trunk Revision Download?Hi Esmi,
If you were to download the beta would it not include the revised theme, but if theme functions change ………?I read about flexible headers, theme preview and selecting headers and backgrounds from media gallery, but not much on theme style changes, more functional.
Regards
David
Hi we had the same thing a couple of days ago, different as it puts 3 post images as thumbnails in a row, but the pastebin code and styles may help.
The counter % 4 returns the remainder 4 so every forth iteration is 0 which is false, the rest return 1 2 or 3 which are true as they have a value.
Have a look at my last reply, it has links to the code, for four columns it would be the width:
.quarter { width: 22.05%; }and the style code:
$counter++; $class = ( $counter % 4 ) ? '<div class="quarter">' : '<div class="quarter last">'; echo $class; //Output the start class /* $counter % 4 returns true 1=1 2=2 3=3 and false on 4 = 0 so the class last is returned when false is returned, 4, 8, 12, 16 */After the row is complete then add:
echo '<div style="clear:both;"></div>';This should give you enough to work with.
HTH
David
Forum: Fixing WordPress
In reply to: What is a featured image?Featured Image is the Post Image!
When you upload a Featured Image WordPress will create several image sizes, thumbnail, medium, large (these three are set in Settings Media), then the post image, plus any other custom sizes the theme needs.
In the case of twenty ten / twenty eleven if the image is 1000px wide or greater it will use a slice of this as the header, a lot of other themes you would upload a smaller theme and use a crop as a thunbnail, in twenty eleven you can coded the content.php / loop.php to display the thumbnails.
HTH
David