alexvaxx
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Custom loop in single post templateThank you very much for that. You’ve been very helpful. //A.
Forum: Fixing WordPress
In reply to: Custom loop in single post templateIt works! Sort of.. I took out the array_reverse function and just merged the arrays like this
array_merge($after, $before);
And that did the trick, the posts show up like this now: 5, 6, 7, 8, 9, 10, 1, 2, 3, 4. Fantastic. Thank you very much. But tell me:
1. Is your version more efficient than the one I posted in the pastebin?
2. Only if you have the time, could you explain to me what lines 3-15 in your code exactly do, just so that I feel like I’ve learned something ??//A.
Forum: Fixing WordPress
In reply to: Custom loop in single post templateHah, now it shows 5, 10, 9, 8, 7, 6, 4, 3, 2, 1. What a mess.
But thanks fot not losing faith ??
Forum: Fixing WordPress
In reply to: How to make the Background smaller, its 1" on each sideThe margins surrounding that page are also dependent on how big your screen and window is. If you stretch your window to make it larger, the margins will (of course) seem bigger. But I guess you mean you want to make the “content”-part of the site wider?
Would you want to make the text wider? Or the sidebar? I’m not sure I’d want to do that.
The designer behind your theme, probably did think about the width of the elements ??But if you don’t know that much css and coding, how about just picking another theme that you like better?
Forum: Fixing WordPress
In reply to: Custom loop in single post templateI tried that now, and it doesn’t quite work. Assume I’m viewing post no. 5, it ends up showing first post no 5 (yay), but then it shows 1,2,3,4, and 6,7,8,9,10 etc.
But what I want is: 5, 6, 7, 8, 9, 10 and then, 1, 2, 3, 4.
Oh well.Forum: Fixing WordPress
In reply to: Custom loop in single post templateNope ??
It just loops through all the posts in a regular order starting at number 1.
And what I don’t understand is, you say
elseif ($found_current)
but “if found_current” what? I guess its just a syntax I’m unfamiliar with, but it seems to me you’re not comparing it against anything?But thank you anyway.
Forum: Fixing WordPress
In reply to: Custom loop in single post templateThank you, but still: I don’t understand how I can then go ahead and actually retrieve/display those posts in the wanted order?
Forum: Fixing WordPress
In reply to: Custom loop in single post templateSo the thing I don’t understand is how I store those posts that are either too “young” or too “old” to be displayed yet, in another array.
Can I just go:
if ( $original_post >= $post->ID ) $before[] = $wp_query->posts;
??
And even if that’s the case, how do I then retrieve those posts from the before-array, when I’m ready to use them?
I’m sorry, but I’ve read the Codex entrys on the loop so many times, but it’s still very complicated to me.
//A
Forum: Fixing WordPress
In reply to: How do I make a post that doesn't appear in the feed?Maybe this is helpful: Stealth Publish
But you probably already found this yourself, since it was the first thing that showed up on google.Forum: Fixing WordPress
In reply to: How to make the Background smaller, its 1" on each sideHi, you don’t need to change the php file, if I understand you correctly; what you want to do is change the css–the stylesheet that is.
But I think it would be helpful if you clarified a bit: what do you mean “make the background smaller”? Do you mean the margins surrounding the whole page, or do you mean the blue header image?
Css is a very good skill to learn if you want to be able to customize your themes yourself ??
Forum: Fixing WordPress
In reply to: Custom loop in single post templateSo, I couldn’t quite figure out how to do the whole “copy posts to array”-deal, so I endedup doing this instead:
Or in other words:
- Display the first loop and save the id in a variable
- Create a new loop that checks against the variable to make sure it only displays the following posts
- Create a third loop that checks against the variable to make sure it only displays the items that are “younger” than the original post
This seems to me to be a bit ineffecient, very php and database request-heavy, so if there’s a smarter way, please let me know!
Forum: Fixing WordPress
In reply to: Custom loop in single post templateThank you for that, I’ll try it out and get back to you!
Forum: Plugins
In reply to: Thumbnail-size-handling widgetSo, I kind of fixed this myself, and for future reference I’ll just walk you guys through what I did.
I’ve added additional, custom thumbnail sizes with the “Additional Image Sizes”-plugin, and simply named them the numbers from 1 to 6.
When adding a new post, I attach an image using the “Featured Image”-feature, and then I’ve created a custom field called “thumbsize” where the numbers from 1 to 6 can be put in.
In my template file I retrieve the featured image using the_post_thumbnail() inputting the value from the thumbsize custom field as the name of the thumbnail I wish to retrieve. Also I make sure that if no input or a number higher than 6 is put in, the image size defaults to size 1.
It look like this.
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. $thumbsize = get_post_custom_values("thumbsize"); if ( $thumbsize[0] >= 1 && $thumbsize[0] <= 6 ) { the_post_thumbnail( $thumbsize[0], array('class' => 'masonrythumb ') ); } else { the_post_thumbnail( '1', array('class' => 'masonrythumb') ); } }
I hope this can be of help to someone. And if anyone has ideas of a better way to solve this, you’re very welcome to comment.
Cheers.
Forum: Themes and Templates
In reply to: Different templates for different authorsThank you, but I think I might ask you to clarify a bit. Are you suggesting I make a conditional statement or what you’d call it? Like “if user level is contributor show this, else show this”? Or?