ivovic
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Using the_content after get_posts on a PageI always like to give those with “web guy” in their name a hard time around here, but lets not and say we did, in this case.
the deal is this … each “view” (category/single/page/index/date archive/ yadda..) has a default query which is presented to the page template rather than performed IN the page template, you dig?
what I mean is, you don’t have to get_posts or query_posts in order to display a simple template of the current view.
the problem is you’re trashing the default query (in particular the default $post variable many times) with your excerpts by the time you get to displaying what SHOULD be contained in the default query later.
you can go about this two ways.
You can either backup your query variables before you nuke them with get_posts, or you can just pull the current page ID again later with get_posts. Up to you which you prefer.
Backing up your query:
before you do your get_posts magic, do this (if you have php5 it may be slightly different):
<?php $temp_query = $wp_query; ?>then you do your get posts stuff. When that’s done you can:
<?php $wp_query = $temp_query; ?>then execute the while loop which normally sits in that page template.
That’s the method in the Codex, but I’ve had limited success with that, so I tend to just pull the post again, in the rare instance that I need to do a loop before the actual page.
Pulling the page again:
Before anything else you do, do this, so you can use the ID later:
<?php $this_page = $post->ID; ?>You can then use the $this_page variable in your switch statement if you like. Either way now it’s not going to be clobbered by your excerpts. Once they’re done, you can:
<?php $postslist = get_posts("post_type=page&include=$this_page"); if ($postslist) foreach ($postslist as $post) { setup_postdata($post); the_content('Read more...'); }tada!
Forum: Fixing WordPress
In reply to: Error text after creating wp-config.php: “p-settings.php’); ?>”Muahaha <3
Forum: Plugins
In reply to: [Plugin: Register Plus] JavaScript error on setup pageI have a similar issue with it not allowing additional fields for the invitation code, or the user defined fields.
clicking the (+) button returns a javascript error:
Line 223
Char 1
Object expectedObviously the line number changes depending on which of the two fields I click – that was for the lower one.
I’ve disabled all other plugins which add javascript to the admin pages, with no improvement noted.
Forum: Fixing WordPress
In reply to: Error text after creating wp-config.php: “p-settings.php’); ?>”so just re-upload the files you screwed with.
Forum: Fixing WordPress
In reply to: Gravatar when my blog pingsback?ahh interesting that you can make YOUR wordpress provide an email address to the other blog, by hacking your xmlrpc.
good to know!
Forum: Themes and Templates
In reply to: What feature(s) would you like to have in a theme?right, having the layout options by choosing a different CSS is a great idea – however, make sure to separate the element positioning from things like font sizes and image stuff, etc…
so that when you pick a different layout, your image borders and font colours stay the same.
to address the navigation stuff, here’s the deal as I see it should be:
1) provide the choice to list Pages as nav items or Categories. In other words, set yourself a variable, which you can use in the theme to tell you which template tag to use, so in your theme you might have something like if($navoption=’pages’) wp_list_pages(blahblah);
Some people might want to list the pages on their site as nav items, others might want to use categories for that purpose – which in my view is often better, but most themes don’t allow the choice.
2) people will invariably (eventually) have more pages and categories on their site than they want to display in their top menu, right? So you have to allow them to either select multiple categories/pages to exclude…. or, which I think is better, actually make them specify which pages/categories to INCLUDE in the menu list.
so once they’ve chosen whether they’re listing pages or categories – give them between 5 and 10 dropdowns boxes allowing them to pick which pages or categories they want included in their menu.
Obviously if in the first option they’ve chosen to list pages — all they see here are pages. If they’ve chosen categories, all they see are categories, right?
3) as for actually excluding or including them… this is a little tricky, but not very.
both wp_list_pages and wp_list_categories provide an include= parameter which takes a comma-separated list of either page IDs, or categor IDs. When your users build their list with your dropdown menus, simply store that list as 1,2,3,4,5 etc, and then pull it into a variable for use in your theme…
wp_list_pages/categores(“include=$myplugin_menuitems”);
…should do the trick then.
4) This is an easy one, but I think you should also provide the option of allowing comments on pages, since they aren’t by default.
5) as for link categories, you could allow them to use a link category for additional menu links if you wanted, but I think that adds extra complexity. If you do that, then you need to have them first MAKE a link category, then tell your theme which link category to use… yadda yadda.
I’m saying get them to choose pages or cats for internal links – then provide 2 extra options for linking offsite. Just a couple of text entry fields each, like:
[link title] [web address]
[link title] [web address]and have them appear at the end of their internal links on the nav bar.
so the nav bar ends up looking something like
[home] [cat1] [cat2] [cat3] [linktitle1]
just to let them link to things like a forum, or their flickr page or whatever. Anyone who wants more than that can set up their own link category and pop it into the header.
this sort of seems like a lot, but the more I think about it, it’s not actually that bad. You just need a couple of fields in the options table to store your stuff.
Forum: Fixing WordPress
In reply to: How to include latests posts from a different blogyou should think seriously about whether you need to use a separate wordpress install to do what you want. Fact is, you probably don’t.
either way, to achieve what you want, you’ll want to use something like magpieRSS (google it) to parse your other blog’s RSS feed.
this isn’t going to be trivial for a beginner, though, so prepare yourself for some research.
Forum: Fixing WordPress
In reply to: Using Date and name based permalinkssure, switch to a windows host that’s prepared to actually support their users.
either way, switching is your only choice… stubbornly trying to get windows to mimic apache’s behaviour, whilst having no control over the server isn’t going to get you very far.
Forum: Fixing WordPress
In reply to: Gravatar when my blog pingsback?Reading this back, I think I misunderstood your intention… you want a gravatar to appear for YOUR pingbacks on ANOTHER blog, right?
Well, you can’t do that. That’s up to the other person.
Forum: Fixing WordPress
In reply to: Gravatar when my blog pingsback?maybe what you want is to use favatars for pingbacks – since they don’t provide an email address to be used with a gravatar, favatars will pull the website’s favicon, using the supplied web link.
In case you don’t already know, the favicon is the icon you see next to the web address in your browser. Look at the address line now – you’ll see the wordpress logo up there.
http://dev.wp-plugins.org/wiki/favatars
people use them for their comments too – but you could easily only use them for pingbacks, and keep using gravatars for comments.
Forum: Everything else WordPress
In reply to: How many plug-ins have you in wordpress ?that’s easily said, if you just want a basic blog.
there’s no positive difference between using a dozen plugins and coding it all into your theme.
Forum: Fixing WordPress
In reply to: Iportant problem with pageschange your permalink structure to something else.
Forum: Fixing WordPress
In reply to: issues navigating within the admin screenswhat’s the blog address specified on the general settings page? got your site URL in there? I realise you can’t update it, but what’s already in there?
Forum: Fixing WordPress
In reply to: Akismet Blocking More Than Spamalso, if its a friend, then you can get him to register a user account on your blog – and get one of those fine “don’t bin my users with akismet” plugins… dozens of which are floating around.
Forum: Fixing WordPress
In reply to: Akismet Blocking More Than Spamwell, the best way is to ask him to stop posting links to cheap cialis and viagra.
you can ask the akismet folks to remove him from the shitlist as well, if he’s a legitimate poster. Chances are he was flagged making a post on someone else’s blog, and with akismet the mud sticks.