{"id":6674,"date":"2022-07-31T11:55:40","date_gmt":"2022-07-31T02:55:40","guid":{"rendered":"https:\/\/the-world-star.com\/?p=6674"},"modified":"2026-11-19T14:04:00","modified_gmt":"2026-11-19T05:04:00","slug":"fixing-duplicate-archives-and-categories-in-wordpress-lightning-theme","status":"publish","type":"post","link":"https:\/\/the-world-star.com\/en\/server\/fixing-duplicate-archives-and-categories-in-wordpress-lightning-theme-6674\/","title":{"rendered":"Fixing Duplicate Archives and Categories in WordPress Lightning Theme"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">By default, the Lightning theme displays categories twice on single post pages. Also, even though I set the homepage to a 2-column layout, it wouldn't display correctly, and changing the settings had no effect\u2014it made no sense at all. Upon closer inspection, I found that the layout structure between the homepage and post pages felt inconsistent and a bit hard to understand. Is this done intentionally to push people into buying the pro version? Here's my analysis of the issue and how to fix it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Lightning Display Issue<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">On mobile, archives and categories appear twice on post pages.<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It looks something like this.<\/p>\n\n\n\n<pre class=\"wp-block-code has-pale-cyan-blue-background-color has-background\"><code>&#91;     \u30bf\u30a4\u30c8\u30eb      ]\n&#91;      \u672c\u6587         ]\n&#91;                   ]\n&#91;                   ]\n&#91; \u524d\u306e\u8a18\u4e8b\/\u6b21\u306e\u8a18\u4e8b ]\n&#91;     \u6700\u8fd1\u306e\u6295\u7a3f    ]\n&#91;     \u30ab\u30c6\u30b4\u30ea\u30fc    ]\n&#91;     \u30a2\u30fc\u30ab\u30a4\u30d6    ]\n&#91;     \u30ab\u30c6\u30b4\u30ea\u30fc    ]\n&#91;     \u30a2\u30fc\u30ab\u30a4\u30d6    ]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Why?! Lightning spec?!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Cause: The sidebar drops to the bottom on mobile views<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you look at the desktop version, you'll understand\u2014on mobile, the sidebar seems to be designed to wrap around to the bottom.<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-green-cyan-background-color has-background\"><code>&#91;     \u30bf\u30a4\u30c8\u30eb      ]&#91;  \u30b5\u30a4\u30c9\u30d0\u30fc ]\n&#91;      \u672c\u6587         ]&#91;             ]\n&#91;                   ]&#91;  \u30ab\u30c6\u30b4\u30ea\u30fc ]\n&#91;                   ]&#91;  \u30a2\u30fc\u30ab\u30a4\u30d6 ]\n&#91; \u524d\u306e\u8a18\u4e8b\/\u6b21\u306e\u8a18\u4e8b ]\n&#91;     \u6700\u8fd1\u306e\u6295\u7a3f    ]\n&#91;     \u30ab\u30c6\u30b4\u30ea\u30fc    ]\n&#91;     \u30a2\u30fc\u30ab\u30a4\u30d6    ]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Because the overall page is quite long, it didn't feel completely out of place at first, but either way, displaying the same information at the bottom of the main text and in the sidebar is redundant on both desktop and mobile views.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The Solution<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Since I've customized the sidebar quite a bit, I want to keep it as is. Naturally, the logical step is to just remove the section at the bottom of the main content, but that's where another weird quirk comes in.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After doing some digging, I found that the area below the main text uses the 'Footer Top (Common across all screens)' widget area to display category and archive blocks. On the other hand, based on my previous code tweaks, the sidebar relies on Lightning's default behavior where PHP handles the display if no sidebar widgets are explicitly configured.<\/p>\n\n\n\n<pre class=\"wp-block-code has-light-green-cyan-background-color has-background\"><code>&#91;     \u30bf\u30a4\u30c8\u30eb      ]&#91;  \u30b5\u30a4\u30c9\u30d0\u30fc ]\n&#91;      \u672c\u6587         ]&#91;             ]\n&#91;                   ]&#91;             ]\n&#91;                   ]&#91;             ]\n&#91; \u524d\u306e\u8a18\u4e8b\/\u6b21\u306e\u8a18\u4e8b ]\n&#91;     \u6700\u8fd1\u306e\u6295\u7a3f    ]\n<mark style=\"background-color:#f78da7\" class=\"has-inline-color has-black-color\">&#91;\u30a6\u30a3\u30b8\u30c3\u30c8-\u30d5\u30c3\u30bf\u30fc\u4e0a\u90e8]<\/mark><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">So, deleting these category and archive blocks from the widget area should do the trick... Time to tinker with widgets for the very first time.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"882\" height=\"439\" src=\"http:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31113114\/Screenshot-from-2022-07-31-11-15-00.png\" alt=\"\" class=\"wp-image-2596\" srcset=\"https:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31113114\/Screenshot-from-2022-07-31-11-15-00.png 882w, https:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31113114\/Screenshot-from-2022-07-31-11-15-00-300x149.png 300w, https:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31113114\/Screenshot-from-2022-07-31-11-15-00-768x382.png 768w\" sizes=\"auto, (max-width: 882px) 100vw, 882px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Ah, this must be it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"484\" src=\"http:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31113215\/Screenshot-from-2022-07-31-11-15-22.png\" alt=\"\" class=\"wp-image-2598\" srcset=\"https:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31113215\/Screenshot-from-2022-07-31-11-15-22.png 910w, https:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31113215\/Screenshot-from-2022-07-31-11-15-22-300x160.png 300w, https:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31113215\/Screenshot-from-2022-07-31-11-15-22-768x408.png 768w\" sizes=\"auto, (max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Oh nice, the layout is right there. Let's delete these blocks and clean things up.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Homepage Looks Broken<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Or so I thought\u2014the post pages ended up looking just the way I wanted. However, the homepage looked messed up. For some reason, the sidebar disappeared entirely from the homepage, and categories and archives were nowhere to be found... Toggling 1-column or 2-column layout settings made zero difference for some reason.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Investigating and Fixing the Homepage<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Looking closely at the widget settings screen, it appears that sidebars are separated by page types. This means the homepage sidebar (which has no widgets set by default) and the post page sidebar (where widgets aren't set by default \u2192 Lightning renders them via code) are two completely different things. I'm pretty sure the sidebar code I previously tweaked was only meant for posts. What's really confusing is that the homepage vertically stacks [Main Text] \u2192 [Categories] \u2192 [Archives], whereas post pages display [Categories] and [Archives] in the sidebar. Make up your mind and keep it consistent!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"657\" height=\"732\" src=\"http:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31113633\/Screenshot-from-2022-07-31-11-36-04.png\" alt=\"\" class=\"wp-image-2599\" srcset=\"https:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31113633\/Screenshot-from-2022-07-31-11-36-04.png 657w, https:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31113633\/Screenshot-from-2022-07-31-11-36-04-269x300.png 269w\" sizes=\"auto, (max-width: 657px) 100vw, 657px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So, as a temporary fix, all I need to do is create a dedicated 'Sidebar (Homepage)'. Since this applies only to the homepage, it won't affect post pages and won't cause any duplicate displays. You can set this up just like writing a post by adding a block and searching for 'Categories' or similar. Gotta love WordPress for making this easy.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"828\" height=\"640\" src=\"http:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31114439\/Screenshot-from-2022-07-31-11-44-09.png\" alt=\"\" class=\"wp-image-2601\" srcset=\"https:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31114439\/Screenshot-from-2022-07-31-11-44-09.png 828w, https:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31114439\/Screenshot-from-2022-07-31-11-44-09-300x232.png 300w, https:\/\/static.the-world-star.com\/wp-content\/uploads\/2022\/07\/31114439\/Screenshot-from-2022-07-31-11-44-09-768x594.png 768w\" sizes=\"auto, (max-width: 828px) 100vw, 828px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">At the end of the day, what's the best way to handle this?<\/p>\n\n\n<ul class=\"wp-block-list\">\n<\/ul>\n\n\n<p class=\"wp-block-paragraph\">With this setup, post page sidebars are rendered via Lightning's PHP code, while homepage sidebars are rendered using widget blocks.<br>That said, while the visual issue is resolved, the underlying structural inconsistency remains. The original goal was to 'shorten the archive display,' and that fix still needs to be applied to both. Wondering if I should just make the homepage use the custom code-driven sidebar as well?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, the Lightning theme displays categories twice on single post pages. Also, even though I set the homepage to a 2-column layout, it wouldn't display correctly, and changing the settings had no effect\u2014it made no sense at all. Upon closer inspection, I found that the layout structure between the homepage and post pages felt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2606,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/175.41.248.22\/?p=2592","_lightning_design_setting":{"layout":"default"},"footnotes":""},"categories":[3],"tags":[1243,1244,67,81,961],"class_list":["post-6674","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-archives","tag-categories","tag-server","tag-lightning","tag-troubleshooting","en-US"],"_links":{"self":[{"href":"https:\/\/the-world-star.com\/wp-json\/wp\/v2\/posts\/6674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/the-world-star.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/the-world-star.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/the-world-star.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/the-world-star.com\/wp-json\/wp\/v2\/comments?post=6674"}],"version-history":[{"count":1,"href":"https:\/\/the-world-star.com\/wp-json\/wp\/v2\/posts\/6674\/revisions"}],"predecessor-version":[{"id":6675,"href":"https:\/\/the-world-star.com\/wp-json\/wp\/v2\/posts\/6674\/revisions\/6675"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/the-world-star.com\/wp-json\/wp\/v2\/media\/2606"}],"wp:attachment":[{"href":"https:\/\/the-world-star.com\/wp-json\/wp\/v2\/media?parent=6674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/the-world-star.com\/wp-json\/wp\/v2\/categories?post=6674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/the-world-star.com\/wp-json\/wp\/v2\/tags?post=6674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}