Need some help with the theme customization
-
Hello,
I am building a website for a client. Most of the design part has been completed. But I am stumped on 2 requirements from the client.
- The News section needs to display a specific set of pages instead of the blog posts.
- The footer needs to display a navigation panel
Please let me know if its possible.
I have set up a child theme and have effected all other edits there.
-
One other issue is the way the categories are getting displayed in the side bar. At the moment the categories are getting displayed as Step 1, Step 11 etc. Is it possible to change this to display in proper order like, Step 1, Step 2 etc..
Thanks in advance.
Hi @edhruv,
The News section needs to display a specific set of pages instead of the blog posts.
It is possible to achieve what you’re after but will require you to experiment a little with the theme’s PHP and HTML.
If you’re comfortable doing that then the first step is for you to set up a child theme.
In case you’re unsure, the following guides provide a good introduction to child themes, including steps to set one up:
- https://codex.ww.wp.xz.cn/Child_Themes
- https://wordpress.tv/2015/05/12/kathryn-presner-getting-comfortable-with-child-themes/
After you have completed that step, copy the parent’s content-front-news.php file to your child theme’s directory and then open it in your favourite text/code editor.
Locate the following code in that file:
<?php $sticky = get_option( 'sticky_posts' ); $args = array( 'posts_per_page' => 7, 'ignore_sticky_posts' => 1, 'post__not_in' => $sticky, 'category_name' => 'markup', ); $query = new WP_Query( $args ); if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); get_template_part( 'content', 'news' ); endwhile; endif; ?>The above code is pulling in the list of latest posts to the latest news section of Harmonic’s home page.
You can add and edit the WP_Query parameters in order to display pages instead. The following documentation further details WP_Query and the options available to you:
The footer needs to display a navigation panel
The theme does display navigation in the footer by default, as you can see on the theme’s demo site:
https://harmonicdemo.wordpress.com/
Is the above what you’re trying to achieve? If you’d like a more custom navigation menu, then you’ll need to register and create a new one via your child theme. You can find documentation around the code you’ll need to do this here:
One other issue is the way the categories are getting displayed in the side bar. At the moment the categories are getting displayed as Step 1, Step 11 etc. Is it possible to change this to display in proper order like, Step 1, Step 2 etc..
Are you using a widget to display your categories in the sidebar? If you could possibly share a link to the site you’re customising, that will help me get a clearer idea of what you’re trying to achieve.
Thanks!
Thanks so much for the response for the first 2 parts of my post. I will try it out and see if I can get it to work for me.
About the issue with the categories, I am using the default categories widget thats there in the installation. You could see the issue here on the blog http://www.aattitudeofgratitude.com/blog/. If you look under the Categories heading in the sidebar, you could see the categories getting displayed the way they are π
Thanks again for your help.
Thank you for clarifying, @edhruv!
There isn’t a way to change the default ordering of the category widget, however, as a workaround you could use the Custom Menu widget instead.
As a first step to this: Navigate to Appearance > Menus in your admin area and set up a new custom menu. Add all the links to your category pages in the order you want to your new menu.
You can then assign your new menu to the Custom Menu widget, which will display the list of categories in the order you’ve set.
Hope that’s clear! We’re right here if questions come up as you walk through the above.
Thank you!! That worked like a charm! π
However, I am still having issues with the footer. Though I set up the footer as you advised, the registration does not seem to be active and its calling for the main menu itself in the footer as well as you can see below. Do you see anything I set up wrong?
How are you calling the menu in your child theme’s footer.php file? It should look similar to the following:
<?php wp_nav_menu( array( 'theme_location' => 'menu-name' ) ); ?>menu-name should be replaced with the name you’ve chosen for your separate footer menu.
yes thats how its been set.
It reads
<?php wp_nav_menu( array( ‘theme_location’ => ‘footer-menu’ ) ); ?>
Ahh.. wait! I just noticed!!
The menu name was to be set only as ‘footer’ but I added ‘-menu’ in there and thats what been messing up my day!
Duh!!
Thanks a ton for all the help! You are an angel!!
Ah, great!
Mistakes like that have cost me time with code in the past, too. π I’m so glad you were able to spot that the name was incorrect and that the footer menu’s displaying correctly now.
The topic ‘Need some help with the theme customization’ is closed to new replies.
