Articles of archives

WordPress showing wrong category name

I’m using: $category = get_the_category(); echo $category[0]->cat_name; to display the current category as a header in an archive template (example of local url is http://imac.local:5757/category/accommodation/, http://imac.local:5757/category/service/ etc) For the first 3 categories, this works fine, but after that it’s showing a child category instead. I’ve tried changing the slug of the posts and the category, […]

Blog pages show at most unrecognized by code

This is the code I use to grab my post archives and style the first post differently. (Full code linked.) This code does not seem to be recognizing the “Blog pages show at most” setting under Settings > Reading. I am unsure why. Help is appreciated! <?php while (have_posts()) : the_post(); ?> <?php $postvariable++; /* […]

Modify loop output for a specific list of categories

I’m trying to modify the output of a loop on an archive page for a specific list of categories. Normally this loop outputs the Title, Author, Date and does so for every post in that given category. I have a list of categories in which I’d like to modify that output to include images. Up […]

Custom Post Type Archive Pagination

I’ve set up a template called archive-gallery.php, and I have pagination working, however, the query is ignoring my posts_per_page value and using the value that is in Settings > Reading called Blog Pages Show At Most. My gallery archive page is showing 8 posts per page, which I set, and I have 48 posts in […]

How to display post in custom file not in archive file?

I create file content-expertises.php and display my category list. Now, When I click one my category name, it is redirect in category.php file not my custom created file like category-expertise.php. My current path is: http://hostname/expertises/project-reviews/ When I click my category name it is redirect in: http://hostname/categories/category-name/ But, not redirect in my custom created (file is […]

Creating attachments archive in tags and categories

Per this question (How to create an attachments archive with working pagination?), I’ve been using the following function to have archive pages display attachments as well as pages and posts. It was working for the preexisting tag and category archive pages, but it stopped working a few weeks ago (possibly due to a WordPress update, […]

How to set default archive image without overriding first attached image?

I have hit a wall. I have archive pages with some posts that have featured images which display fine. Some posts don’t have featured images but the first attached image displays. Some posts have no images and there is a blank space. I have been trying all day to find a way to display a […]

WordPress archives in header -necessary?

I just had a look at my source code and found that at the very beginning there’s this really long list of archives. I haven’t seen this on other blogs: <link rel=”pingback” href=”http://zoomingjapan.com/xmlrpc.php” /> <link rel=’archives’ title=’May 2015′ href=’http://zoomingjapan.com/2015/05/’ /> <link rel=’archives’ title=’April 2015′ href=’http://zoomingjapan.com/2015/04/’ /> (…. lots more …) <link rel=’archives’ title=’November 2011′ href=’http://zoomingjapan.com/2011/11/’ […]

Make tag archive display post are ordered by post format

I would like to set up an archive page for tags where posts are displayed separated depending on post format, first post-format-aside then an archive with all posts except the posts already displayed, from-post format-aside. So first I want 4 posts with the post-format-aside format and then I want an archive but without posts from […]

Dynamic category name in query post

I want to make the following query_posts to use the current page’s category name. For example, the user is located at: examplesite.com/category/apples/, and i want to use “apples” and for a different category (say “pears”), then dynamically add “pears to the following query_posts function: <?php query_posts(‘category_name=apples’); ?> Also, can this be amended to display only […]