The Categories link and and Archives links not working

Hi,

The blog posts links work well. The Categories link for Our Work/Projects (Sydney FP:Portfolio) in all device view and Archives links (non-desktop view only) is not working well.

www.theideashark.com/blog

Please help! urgent!

Thank you

Bryan Chin

Hello there,

I do apologize for the long delay. I don’t mean to. I’ve been working with our lead developer to address this. But due to Christmas and holidays, we can’t manage it faster. Please wait till the end of holidays.

Thank you for your understanding.

Regards,
Kharis

Hi Kharis,

Noted with thanks.

Please keep me update as soon as possible. Appreciate your help much.

Bryan Chin

Hi,

We’re not actually including the Projects in the archives, that’s why they’re not showing. We might add them in the next version but if it’s urgent you can install the Code Snippets plugin and use this:


function sydney_include_projects_archive($query) {
	if ( !is_admin() && $query->is_main_query() ) {
	    if ( $query->is_archive() ) {
			$query->set('post_type', array( 'post', 'projects' ) );
		}
	}
}
add_action('pre_get_posts','sydney_include_projects_archive');

Hi Vlad,

I know that the projects are not included in the archives.

My problems are:

  1. The Categories link for Our Work/Projects (Sydney FP:Portfolio) in all device view but not Archives

  2. The Archives links for my blog posts( mobile and tablet view only) is not working well. The links keep showing my old blog posts but not the updated blog posts while in the mobile and table view. however, the archives links work well while in desktop view.

Please check my website www.theideashark.com

Please advice. It’s urgent for me to finalise my website design.

Bryan Chin

  1. Yes, when I say archives I mean categories. So when you go and visit a category page that you know it should show projects, it won’t show those projects without the code I posted.

  2. Could be cache.

I think your permalinks are a bit messed up all around. I can’t access most links. Have you changed something to your htaccess?

Hi Vlad,

  1. Noted.

  2. I never change the htaccess. I don’t even know where is the htacccess file. I can give you my username and password for my Wordpress account access if you need it. Or any other solution?

Please advice. Your help is much appreciated.

Bryan Chin

Yeah you can create an account for me and send it to vlad[at]athemes.com. I’ll take a look around and see if I notice anything wrong. Especially with the links, for example this doesn’t work for me: http://www.theideashark.com/blog/

Hi Vlad,

May I know how I create an account for you?

Or I directly email you my Wordpress account username and password? So you can log in my Wordpress account and check for the details.

Please advice.

Thank you

Bryan Chin

It’s better to create a new account so you can delete it after I’m done. From your admin area go to Users > Add New. Just make sure you set it as Admin.

Edit: please note that you should also change your site address to the non-www version from Settings > General for various reasons, one of them being that certain browsers will block the icons otherwise.

Hi Vlad,

I have add you as my wordpress admin/editor. Please update me if you have found the problem and solution as soon as possible.

Thank you

Bryan Chin

I can’t do much since you haven’t made me an admin, but from what I can see switching to non-www solved everything?
I see all links now work fine and the same 3 posts from desktop also show on mobile.

Hi Vlad,

I have made you as admin. By the way, after switching to non-www. the blog links issue is solved. Thanks a lot and appreciate your help.

Bryan chin

Okay, so is there still any other issue? I’m not seeing any.

Hi Vlad,

No more issue at this moment. Thanks for your advice and Kharis help too.

Bryan Chin

Okay, great. Remember to delete the account you sent for me please.

Hello!

I have added the snippet you suggested to include projects to the category link; with one change-

function sydney_include_projects_archive($query) {
if ( !is_admin() && $query->is_main_query() ) {
if ( $query->is_archive() ) {
$query->set(‘post_type’, array( ‘projects’ ) );
}
}
}
add_action(‘pre_get_posts’,‘sydney_include_projects_archive’);

I made this change because I did not want both my projects and posts to appear on the Projects page. The only issue I am having is that now the posts are not included in the category link. Is there a way to fix this? It is more important for me to show projects for the categories, but I would like to show both projects and posts. The site is www.lafayettehillremodelers.com.

Thanks in advance for your help!!

Holly