Jump to content
Sign in to follow this  
inov8ed

Page permalinks not working?

Recommended Posts

inov8ed

I just noticed that the Previous entries (with or without WP-PageNavi) don't seem to do anything. I am getting exactly the same issue as this post: http://www.pagelines.com/forum/topic.php?id=2078 http://www.inov8-ed.com and http://www.inov8-ed.com/page/2/ Seem to show exactly the same thing. Does anyone have any ideas? Its funny as the navigation seems to work fine when looking at the archives, just not of the main page of the site. Thanks. -Adam

Share this post


Link to post
Share on other sites
inov8ed

Ok, I figured out that it was the hook I was using to remove a category from view on the front page. When I remove the hook, the page permalink issue goes away. The hook I added is:

add_action('pagelines_before_theloop', 'exclude_cat');
	
	function exclude_cat(){
	if (is_home()) {
	query_posts("cat=-20");
	}
	}
	
	function SearchFilter($query) {
	if ($query->is_search) {
	$query->set('cat','-20');
	}
	return $query;
	}
	add_filter('pre_get_posts','SearchFilter');

Any idea where I went wrong in the above to lose the page navigation? Thanks! -Adam

Share this post


Link to post
Share on other sites
inov8ed

Interestingly enough, with the above code, it doesn't break the pagination on the search pages. It seems to be something only on the home page. Is there a better way to get a category to not show up on the home page? -Adam

Share this post


Link to post
Share on other sites
cmunns

It should work fine but you need to modify it a touch to include pagination in the query ` function exclude_cat(){ if (is_home()) { $page = get_query_var('page'); query_posts("cat=-20&paged=$page"); } } `

Share this post


Link to post
Share on other sites
inov8ed

@cmunns, Thanks for the response. I just tried this and it doesn't seem to change the behaviour. I am still getting the same loop on the other pages. The whole hook looks like:

	add_action('pagelines_before_theloop', 'exclude_cat');
	
	function exclude_cat(){
	if (is_home()) {
	$page = get_query_var('page');
	query_posts("cat=-20&paged=$page");
	}
	}
	
	function SearchFilter($query) {
	if ($query->is_search) {
	$query->set('cat','-20');
	}
	return $query;
	}
	add_filter('pre_get_posts','SearchFilter');
	

Is that right? Thanks. -Adam

Share this post


Link to post
Share on other sites
cmunns

Okay try making changing the $page variable to this `$page = (get_query_var('paged')) ? get_query_var('paged') : 1;`

Share this post


Link to post
Share on other sites
inov8ed

That worked and fixed the page issue. However, it did seem to override the magazine style layout settting. It lost the option for full width posts and is now just displaying all the posts as if it was set on the blog page setting. Any way to get that back? Thanks for your help! -Adam

Share this post


Link to post
Share on other sites
Andrew

gonna take some hacking... the 'clips' are shown according to this function `pagelines_show_clip($count, $paged)`

Share this post


Link to post
Share on other sites
inov8ed

Does this replace the $page variable above or does it replace the entire function? How would it change the whole hook code? Thanks! -Adam

Share this post


Link to post
Share on other sites
Andrew

hmmm, well the way we're doing this now really messes up the swing of things as it resets the post counter. All this functionality is handled primary by WordPress, until we mess with it. Couldn't you just get a plugin to accomplish this?

Share this post


Link to post
Share on other sites
inov8ed

Ok. I removed the hook and just tried this plugin: http://ryowebsite.com/wp-plugins/category-visibility/ Seems to work so far. Hides the category and the pagination works fine. It also seems to have some nice features as well (and is WP 3 compatible which most listed on wordpress.org were not). -Adam

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×