Polyclinic Customization

Home Forums Polyclinic Polyclinic Customization

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #22032
    realintegrated
    Participant

    Polyclinic Customization

    Resolved

    Hey there! Have you noticed this support service is provided FREE of charge?
    If you like the speed and accuracy of resolutions, please consider supporting me with a small donation. Thank you

    Consider a donation →

    Hello,

    I’m using the Polyclinic theme as a base for my clients website. It’s a very well coded theme, great work.

    That said, I’m changing many of the design elements including the header and footer. I’d like to re-layout some of the elements in the header, and was wondering if there was a simple way for me to do this in my child theme.

    The code I’d like to edit is located in the /template-parts/menu-primary.php file, but I’d obviously prefer to be able to update the theme down the line so don’t want to modify core files. Is there any way to override these template parts in my child theme?

    Thanks for your assistance.

    #22034
    Oliver Juhas
    Keymaster

    Hi realintegrated,

    Thank you, I’m glad you like the theme :)

    As for layout, in most cases simple custom CSS should do the trick, no need to edit PHP files.

    If you need to edit the template-parts/menu-primary.php file in your child theme, you can just copy the file into your child theme folder keeping the (sub)folder structure (so it becomes my-child-theme-folder/template-parts/menu-primary.php file) and edit the file there. Your edited version will be used on your website while you will still keep the possibility of future theme updates.

    Could you maybe provide more details about what you aim to do, so I can provide more specific solution if needed?

    Best regards,

    Oliver Juhas
    WebMan Design

    #22037
    realintegrated
    Participant

    This is awesome! Thanks. It’s rare I come across a template that allows overrides within nested template folders… it’s generally only root level files… header, footer, etc. Very cool stuff.

    Now that I know I have access to override things, I should be pretty good, but I attached an image of what the header update will become. I need to add the search widget inline with the main nav, then add those small sub-nav items (phone/contact) above it, so I’ll likely need to make some adjustments to the template files.

    If you’ve got suggestions or easy ways to update, I’m all ears! Thanks for your time and for the great theme!

    • This reply was modified 3 weeks, 1 day ago by  Oliver Juhas. Reason: Making the post public as there is no sensitive information shared
    #22039
    realintegrated
    Participant

    Hi Oliver,

    In working on this project, it appears that I’m not able to setup files in my child theme from the includes folder; namely, I’m trying to edit the includes/front/header.php file but mimicking that file structure in my child theme doesn’t seem to work. Any workaround for that?

    Best,
    Nate

    #22041
    Oliver Juhas
    Keymaster

    Hi Nate,

    Please note that my themes are coded for the best flexibility. Overriding every theme file via a child theme is not the best approach, actually. Certain files (main template files) are overridable as whole via a child theme, but as the includes folder contains files full of code and it would not be very manageable to override those files in your child theme. It would render your child theme very difficult to manage as you would need to update the code constantly once the parent theme is updated.

    My themes use 2 approaches for code flexibility: you can override basic template files in your child theme, and you can use action and filter hooks to add/remove/modify any functionality or element of the theme. Using hooks is the most powerful approach in WordPress.

    Thank you for the screenshot and for explanation. I can now provide you with the best and most flexible solution to your issue. Please use this code in your child theme‘s functions.php file to add those additional links and search form to the header:

    function child_theme_header_links_and_search() {
    	?>
    	<div class="header-links-and-search">
    		<ul>
    			<li><a href="my-link-url-1">Link 1 text</a></li>
    			<li><a href="my-link-url-2">Link 2 text</a></li>
    		</ul>
    		<?php get_search_form(); ?>
    	</div>
    	<?php
    }
    add_action( 'tha_header_top', 'child_theme_header_links_and_search', 130 );

    Also, please note that you will most likely need to apply some additional custom CSS styles so the additional links and search form looks as you intended. In case you need some help with this, just reply here. (Or try using your web browser code inspector to determine the CSS for your theme modifications.) Here is an example CSS code:

    .site-header-inner {
    	display: -webkit-box;
    	display: -webkit-flex;
    	display: -ms-flexbox;
    	display: flex;
    	-webkit-box-align: end;
    	-webkit-align-items: flex-end;
    	-ms-flex-align: end;
    	align-items: flex-end;
    }
    
    .main-navigation {
    	margin-left: auto;
    }
    
    .header-links-and-search {
    	margin: 10px 0 10px 30px;
    	line-height: 1.62;
    }
    
    .header-links-and-search ul {
    	margin: 0;
    	list-style: none;
    	text-align: center;
    }
    
    .header-links-and-search li {
    	display: inline-block;
    	margin: 0 10px 10px;
    }

    Feel free to adapt and extend the code to your needs.

    Best regards,

    Oliver Juhas
    WebMan Design

    #22047
    realintegrated
    Participant

    Hi Oliver,

    That is some stellar support, thanks!

    Question – do you do freelance work? Considering you wrote the theme, I’d imagine it’d be far more efficient to have you do modifications to your own theme than my in-house staff. If so, what is your rate and what is your current availability?

    Thanks for your assistance,
    Nate

    • This reply was modified 2 weeks, 6 days ago by  Oliver Juhas. Reason: Making the post public as there is no sensitive information shared
    #22050
    Oliver Juhas
    Keymaster

    Hi Nate,

    I’m sorry, I don’t provide freelance work as I am fully occupied with my own projects.

    However, I am always willing to provide help to my best abilities here on support forum, so you can simply post your questions as new support tickets if you get stuck somewhere and I will answer ASAP.

    Thank you for understanding.

    Best regards,

    Oliver Juhas
    WebMan Design

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.