djdeejay
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Can anyone help me get pagination working correctly in my theme.No worries, with a little bit of tweaking Ive cracked it. There was some code missing from the top of the page which seems to create the pagination upon page refresh.
“<?php $save_post = $post;
$post = get_post( get_option(‘page_for_posts’) ); ?>”I changed it back to ‘page’ and it has worked.
One question though. On my home page I don’t really want pagination anyway – I just want it to display the latest 3 posts dynamically. Is there a setting to turn off and hide the pagination options literally just displaying the three posts in a grid? I can’t see the option anywhere on the links provided to be able to do this…
Forum: Themes and Templates
In reply to: Can anyone help me get pagination working correctly in my theme.Thanks Esmi,
Id seen most of those but stumped across this page http://scribu.net/wordpress/wp-pagenavi/right-way-to-use-query_posts.html which seemed to be exactly what I wanted.
So i replaced the code in the past bin with this.
<?php query_posts( array( ‘cat’ => 9, ‘posts_per_page’ => 3, ‘paged’ => get_query_var(‘paged’))); ?>
However I’m left with exactly the same problem, it display the first 3 posts fine and the pagination options appear, but clicking on page two just refreshes the page…
I tried changing “paged” for “page” – as it is a page template as that website suggests, but in this case it strangely just displays one post only and pagination still doesn’t work.
Hi alchymyth,
ok, a little closer now. The theme dev said the blog page (or category) page is in the index.php.
So I’ve made a new page template (page-grid) and copied the code in. The idea being that I then get individual control over the page as I can’t do anything when the category page is generated automatically from the index.php.
The page generates and works fine apart from its not pulling blog posts and of course there is no where to set the category as it works a different way than the auto generating one.
Here is the code currently.
How can I change it to pull posts from a specific category ID and still keep its title and subtitle heading set in the page settings.
I don’t mind setting up page templates for each category I want to display – there would only be at maximum 3 and it gives me a lot of control over each – but its just getting it to display the posts from a specific category with the same formatting the current category page does…
I know the template will be used for all categories but I just want to get it worked from a total basic standpoint first by entering the title by hand, but even thats not appearing.
Infact no titles are appearing no matter what settings I have so something isn’t right somewhere.
I said there wasn’t one and asked if I created one would WordPress pick it up automatically and you answered me, just above…
Ive copied my index.php into the category.php and everything formats ok now – but despite trying to delete the php call between the H1 tags and just type in a static title it still doesn’t’ display unfortunately.
…except in my case here it isn’t as as soon as I remove the title php from all the posts in that specific category the title disappears from my category page as I’ve said.
So what I need to do is recreate the default category.php must dynamically create when one doesn’t exist in the theme folder and force it to use its own title…
Ah ok, I don’t suppose there is an easy way to pull the category page WordPress creates by default into my category.php as a starting path is there (all I really need to do is add the title code to the top of it really…)
Well there is no category.php in the themes folded for a start off…
If I create one will WordPress pick it up automatically or does the theme need to reference it somewhere else?
I would imagine they are hidden by php as it was a custom post rule I was using he didn’t even want to be available on post types and has since removed. My answer to that was to rip the post and subtitle php out of the standard post template – which does the job for me.
Problem then of course is I’m stuck with this. I don’t understand why the category page is even interested or looking at what the post titles are doing when it has its own post title and subtitle?
Forum: Fixing WordPress
In reply to: Multiple blog SECTIONS (not separate sites) on single site.@starverte am I correct in thinking I can make a custom post type appear in the left hand side bar of admin panel where pages. posts etc appear?
Forum: Fixing WordPress
In reply to: Multiple blog SECTIONS (not separate sites) on single site.Thanks guys – I think the way I was thinking it would work is similar to what Justin said.
@starverte could you expand slightly on your side with the custom post type name?
Forum: Hacks
In reply to: Change default search string "?s=" to permalink structure?Hi Devin, could I e-mail it to you?
Forum: Hacks
In reply to: Change default search string "?s=" to permalink structure?Hi Devin,
Thanks for your help…seem to nearly be there!
In theory this should work. In reality my page keeps giving me “no results found” which is if its accessing the search.php file properly it shouldn’t be as thats basically a parsed dynamic file which uses the search term to trigger some plugins to create a unique page.
Forum: Hacks
In reply to: Change default search string "?s=" to permalink structure?Hi Devin,
Ok ive put it in and now I see what you mean and how it works in practice.
You’re right its not a redirect in that if you still link to /?s= it will work and keep the URL the same, I guess thats a good thing really, it means no extra plugins (like “nice search”, no redirects, no broken links and no features broken when updating the site)
Now two tweeks – are these at all possible?
Can I change the folder name from /search/ ? – Id like it to be something else to distance it from the search criteria.
Secondly can I change the “+” = space, to “-” = space?
Danny
Forum: Hacks
In reply to: Change default search string "?s=" to permalink structure?Ah yes, that’s what I want.
So if I make a link directly to /search/blah it’ll do the search?
Can I now use any search terms after the last trailing slash so…
/search/red-boots would in default settings have to be linked to /?s=red+boots
Seems almost too simple as people were writing huge threads on trying to do something similar but not as advanced and using rewrite.php in wo-includes to make the changes. Also this if it works the way I described here works a lot better than the plugin “nice search” – i don’t know why it wouldn’t use this method.
I’ll test it out in the morning and let you know how I get on…