json21
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to build a custom query in Twenty ElevenIt works. Thanks again.
Forum: Fixing WordPress
In reply to: How to build a custom query in Twenty ElevenI created /images/headers folders in themes/twenty_eleven_sticky and uploaded all the files that belong to this folder from the parents theme (chessboard-thumbnail.jpg, chessboard.jpg, hanoi-thumbnail.jpg, hanoi.jpg etc…).
Then I added the code to functions.php (in the child theme), changed theme to Parent Twenty Eleven, uploaded a header image, and then switched to Twenty_Eleven_Sticky and the image doesnt show…
I would like to be able to simply inherit the current header image from the Parents theme to the child theme (after switching to Twenty_Eleven_Sticky). Now it just goes back to default images…
Forum: Fixing WordPress
In reply to: How to build a custom query in Twenty ElevenYes. It works. I used a child theme. It is for a network of about 200 blogs, and the only thing I would need to change is to keep the header image from the parent blog in the child theme also. Right now it switches back to the default (tree, chess board, cone etc).
I know I can re-upload it, but it would be easier to get around this one in the code.
Forum: Fixing WordPress
In reply to: How to make child theme use parent theme's header image?I have style.css, index.php, and functions.php in child theme folder. This is a Multisite subdomain installation. After changing the theme to child theme Twenty Eleven 1.4 goes back to the default image (one of these with cones, trees, chess board etc)
Forum: Fixing WordPress
In reply to: How to build a custom query in Twenty ElevenThank you.
Forum: Fixing WordPress
In reply to: How to build a custom query in Twenty ElevenThis is from wp-includes/query.php
// Put sticky posts at the top of the posts array $sticky_posts = get_option('sticky_posts'); if ( $this->is_home && $page <= 1 && is_array($sticky_posts) && !empty($sticky_posts) && !$q['ignore_sticky_posts'] ) { $num_posts = count($this->posts); $sticky_offset = 0; // Loop over posts and relocate stickies to the front. for ( $i = 0; $i < $num_posts; $i++ ) { if ( in_array($this->posts[$i]->ID, $sticky_posts) ) { $sticky_post = $this->posts[$i]; // Remove sticky from current position array_splice($this->posts, $i, 1); // Move to front, after other stickies array_splice($this->posts, $sticky_offset, 0, array($sticky_post)); // Increment the sticky offset. The next sticky will be placed at this offset. $sticky_offset++; // Remove post from sticky posts array $offset = array_search($sticky_post->ID, $sticky_posts); unset( $sticky_posts[$offset] ); } }Does it sound like a good idea to modify this one?
Forum: Fixing WordPress
In reply to: How to build a custom query in Twenty ElevenThanks. What would I be looking at if I would like to have 10 posts per page (1, 2, 3 etc) and 9 + 1 (sticky) on the main?
Forum: Fixing WordPress
In reply to: How to build a custom query in Twenty ElevenI dont have a static page. I think that index.php directs to content.php
<?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?>content.php looks like this:
There is an is_sticky() function on the top. I was trying to make some changes there but I was not able to get to the point where sticky displays on the bottom.
I think I would need to look at thinks like “Using the WP_Query Object”, “Building a custom query”, “Using query_posts()”, “Uisng get_posts()” etc.
Forum: Fixing WordPress
In reply to: How to display sticky on the bottom instead of the top of the page?Thanks. I’ve seen this post on the same subject:
http://wordpress.org/support/topic/how-to-put-sticky-posts-to-the-bottom-of-the-page?replies=2
Where is the code that makes sticky appear on the top of the main page? (I know about the code in content.php, and wp-includes/post.php).
Is there any way to make a modification somewhere / somehow? I tried several plugins, but none of them seem to work with Twenty Eleven 1.4 (but modifying the code would be a lot better)
I changed the code, and even though the sticky post code is on the bottom, it is still showing on the top. Does anybody know what makes sticky posts display on the top, and let’s say not on the bottom of the bage (or in the middle of page 3 etc)?
Thank you.
I am not sure, but maybe this is the right direction. Does anybody have an idea why id doesn’t work (it doesnt show any posts at all)?