hmahraj
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to add title to headerCan I use anthing here to create a site title?
Forum: Fixing WordPress
In reply to: How to add title to header<?php /** * The Header of the theme. * * Displays all of the <head> section and everything up till <main id="main"> * * @package Modality */ ?><!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width"> <link rel="profile" href="https://gmpg.org/xfn/11"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <div id="grid-container"> <div class="clear"></div> <?php $modality_theme_options = modality_get_options( 'modality_theme_options' ); if ($modality_theme_options['header_top_enable'] == '1') { get_template_part( 'top', 'header' ); } ?> <?php if (get_header_image()!='') { ?> <div id="header-holder" style="background: url(<?php echo esc_url(header_image()); ?>) 50% 0 no-repeat fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;"> <?php } else { ?> <div id="header-holder"> <?php } ?> <div id ="header-wrap"> <nav class="navbar navbar-default"> <div id="logo"> <?php if ( $modality_theme_options['logo'] != '' ) { ?> <a href="<?php echo esc_url( home_url( '/' ) ) ?>"><img src="<?php echo esc_url($modality_theme_options['logo']); ?>" alt="<?php echo esc_attr($modality_theme_options['logo_alt_text']); ?>"/></a> <?php if ($modality_theme_options['enable_logo_tagline'] == '1' ) { ?> <h5 class="site-description"><?php echo esc_attr(bloginfo('description')); ?></h5> <?php } ?> <?php } else { ?> <a href="<?php echo esc_url( home_url( '/' ) ) ?>"><?php esc_attr(bloginfo( 'name' )); ?></a> <?php if ($modality_theme_options['enable_logo_tagline'] == '1' ) { ?> <h5 class="site-description"><?php echo esc_attr(bloginfo('description')); ?></h5> <?php } ?> <?php } ?> </div> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div><!--navbar-header--> <div id="navbar" class="navbar-collapse collapse"> <?php if (has_nav_menu('main_navigation')) { $modality_default_menu = array( 'theme_location' => 'main_navigation', 'menu' => 'main_navigation', 'depth' => 0, 'container' => false, 'menu_class' => 'nav navbar-nav', 'fallback_cb' => 'wp_page_menu', 'walker' => new wp_bootstrap_navwalker(), ); } else { $modality_default_menu = array( 'theme_location' => 'main_navigation', 'menu' => 'main_navigation', 'depth' => 0, 'container' => false,
Forum: Fixing WordPress
In reply to: How to add title to headerI clicked the link and it took me to the sub domain. Rats! How can I find this code from the parent theme is there is no copy of it? There is only one back up from those times. And I see thay was the test site. This is what I found.
Forum: Fixing WordPress
In reply to: How to add title to headerI didn’t think so. The person who set up the site initially may have made edits to the header in the parent them before the child theme was established; the search box included, which I think might be the original position for the site title. I can forgo the tagline but the site title could go nicely where the search box is.
Would this work?
Add this code from the sub domain’s header.php for site title I gave you earlier in post and just omit YOUNG ADULT?
<div class=”header-main”>
<h1 class=”site-title”>HERSHEY PUBLIC LIBRARY</h1>If yes, would you do this?
Remove <form role=”search” method=”get” class=”search-form” action=”https://hersheylibrary.org/”> (line 53)
Take the contents of line 84, which should be <?php get_search_form(); ?>, and put that on line 53 where the other stuff was; meaning <form role=”search” method=”get”….Exactly where would I place the code for the title: after what?
Thank you, Michael for your prompt responses!
Forum: Fixing WordPress
In reply to: How to add title to header<?php /** * The Header of the theme. * * Displays all of the <head> section and everything up till <main id="main"> * * @package Modality */ ?><!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width"> <link rel="profile" href="https://gmpg.org/xfn/11"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <div id="grid-container"> <div class="clear"></div> <?php $modality_theme_options = modality_get_options( 'modality_theme_options' ); if ($modality_theme_options['header_top_enable'] == '1') { get_template_part( 'top', 'header' ); } ?> <?php if (get_header_image()!='') { ?> <div id="header-holder" style="background: url(<?php echo esc_url(header_image()); ?>) 50% 0 no-repeat fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;"> <?php } else { ?> <div id="header-holder"> <?php } ?> <div id ="header-wrap"> <nav class="navbar navbar-default"> <div id="logo"> <?php if ( $modality_theme_options['logo'] != '' ) { ?> <a href="<?php echo esc_url( home_url( '/' ) ) ?>"><img src="<?php echo esc_url($modality_theme_options['logo']); ?>" alt="<?php echo esc_attr($modality_theme_options['logo_alt_text']); ?>"/></a> <?php if ($modality_theme_options['enable_logo_tagline'] == '1' ) { ?> <h5 class="site-description"><?php echo esc_attr(bloginfo('description')); ?></h5> <?php } ?> <?php } else { ?> <a href="<?php echo esc_url( home_url( '/' ) ) ?>"><?php esc_attr(bloginfo( <code>name</code>)); ?></a> <?php if ($modality_theme_options['enable_logo_tagline'] == '1' ) { ?> <h5 class="site-description"><?php echo esc_attr(bloginfo('description')); ?></h5> <?php } ?> <?php } ?> </div> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div><!--navbar-header--> <form role="search" method="get" class="search-form" action="https://hersheylibrary.org/"> <div id="navbar" class="navbar-collapse collapse"> <?php if (has_nav_menu('main_navigation')) { $modality_default_menu = array( 'theme_location' => 'main_navigation', 'menu' => 'main_navigation', 'depth' => 0, 'container' => false, 'menu_class' => 'nav navbar-nav', 'fallback_cb' => 'wp_page_menu', 'walker' => new wp_bootstrap_navwalker(), ); } else { $modality_default_menu = array( 'theme_location' => 'main_navigation', 'menu' => 'main_navigation', 'depth' => 0, 'container' => false,
Forum: Fixing WordPress
In reply to: How to add title to headerI am not sure about the first thing ask. I will try to see. The following is the header.php in the child theme.
Forum: Fixing WordPress
In reply to: How to move search boxI can see both codes in the header.php of the child theme and understand what you are describing. I will try it tomorrow if I feel brave enough!
Thank you, Susan, for such great support. I will look in to FTP. I am familiar with using Notepad++.Question: in the Modality child theme editor, (Theme #1) from a dropdown I can select files: style.css or header.php or footer.php and there’s a blank place (Theme #2) to the right of it to copy from one to another so you can repace the original if the change doesn’t work. I also copy all the header.php or style.css into a text file to save it in case I deleted and couldn’t get it back in the right position. Is this the same as your instrctions 1. and 2.?
I do not see these lines 84 and 53 in the child theme. By looking at the page source, I can see numbers, but that it not the same thing, right? How do I see the line numbers in the child theme?
Forum: Fixing WordPress
In reply to: How to add title to headerThank you, Michael. I checked under Appearance > Customize > Header > Site Identity that it says Hershey Public Library with the tagline Access is All, and it does. Could something be suppressing the title and tagline, like a plugin? Or, could it have been deleted from the parent theme before the child theme was installed?
I have 2 sub domains linked to the site, and their Site Indentity appears where it should in: For example –
`<div class=”header-main”>
<h1 class=”site-title”><a href=”https://ya.hersheylibrary.org/” rel=”home”>HERSHEY PUBLIC LIBRARY YOUNG ADULTS</a></h1>`Struggling. ??
Forum: Fixing WordPress
In reply to: How to move search boxSorry, I forgot the barticks.
<?php /** * The Header of the theme. * * Displays all of the <head> section and everything up till <main id="main"> * * @package Modality */ ?><!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width"> <link rel="profile" href="https://gmpg.org/xfn/11"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <div id="grid-container"> <div class="clear"></div> <?php $modality_theme_options = modality_get_options( 'modality_theme_options' ); if ($modality_theme_options['header_top_enable'] == '1') { get_template_part( 'top', 'header' ); } ?> <?php if (get_header_image()!='') { ?> <div id="header-holder" style="background: url(<?php echo esc_url(header_image()); ?>) 50% 0 no-repeat fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;"> <?php } else { ?> <div id="header-holder"> <?php } ?> <div id ="header-wrap"> <nav class="navbar navbar-default"> <div id="logo"> <?php if ( $modality_theme_options['logo'] != '' ) { ?> <a href="<?php echo esc_url( home_url( '/' ) ) ?>"><img src="<?php echo esc_url($modality_theme_options['logo']); ?>" alt="<?php echo esc_attr($modality_theme_options['logo_alt_text']); ?>"/></a> <?php if ($modality_theme_options['enable_logo_tagline'] == '1' ) { ?> <h5 class="site-description"><?php echo esc_attr(bloginfo('description')); ?></h5> <?php } ?> <?php } else { ?> <a href="<?php echo esc_url( home_url( '/' ) ) ?>"><?php esc_attr(bloginfo( 'name' )); ?></a> <?php if ($modality_theme_options['enable_logo_tagline'] == '1' ) { ?> <h5 class="site-description"><?php echo esc_attr(bloginfo('description')); ?></h5> <?php } ?> <?php } ?> </div> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div><!--navbar-header--> <form role="search" method="get" class="search-form" action="https://hersheylibrary.org/"> <div id="navbar" class="navbar-collapse collapse"> <?php if (has_nav_menu('main_navigation')) { $modality_default_menu = array( 'theme_location' => 'main_navigation', 'menu' => 'main_navigation', 'depth' => 0, 'container' => false, 'menu_class' => 'nav navbar-nav', 'fallback_cb' => 'wp_page_menu', 'walker' => new wp_bootstrap_navwalker(), ); } else { $modality_default_menu = array( 'theme_location' => 'main_navigation', 'menu' => 'main_navigation', 'depth' => 0, 'container' => false, 'menu_class' => 'nav-bar', 'fallback_cb' => 'wp_page_menu', ); } wp_nav_menu( $modality_default_menu ); ?> <?php get_search_form(); ?> </div><!--/.nav-collapse --> </nav> </div><!--header-wrap--> </div><!--header-holder-->
Forum: Fixing WordPress
In reply to: How to move search box<?php
/**
* The Header of the theme.
*
* Displays all of the <head> section and everything up till <main id=”main”>
*
* @package Modality
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset=”<?php bloginfo( ‘charset’ ); ?>”>
<meta name=”viewport” content=”width=device-width”>
<link rel=”profile” href=”https://gmpg.org/xfn/11″>
<link rel=”pingback” href=”<?php bloginfo( ‘pingback_url’ ); ?>”>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id=”grid-container”>
<div class=”clear”></div>
<?php $modality_theme_options = modality_get_options( ‘modality_theme_options’ );
if ($modality_theme_options[‘header_top_enable’] == ‘1’) {
get_template_part( ‘top’, ‘header’ );
} ?>
<?php if (get_header_image()!=”) { ?>
<div id=”header-holder” style=”background: url(<?php echo esc_url(header_image()); ?>) 50% 0 no-repeat fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;”>
<?php } else { ?>
<div id=”header-holder”>
<?php } ?>
<div id =”header-wrap”>
<nav class=”navbar navbar-default”>
<div id=”logo”>
<?php if ( $modality_theme_options[‘logo’] != ” ) { ?>
“><img src=”<?php echo esc_url($modality_theme_options[‘logo’]); ?>” alt=”<?php echo esc_attr($modality_theme_options[‘logo_alt_text’]); ?>”/>
<?php if ($modality_theme_options[‘enable_logo_tagline’] == ‘1’ ) { ?>
<h5 class=”site-description”><?php echo esc_attr(bloginfo(‘description’)); ?></h5>
<?php } ?>
<?php } else { ?>
“><?php esc_attr(bloginfo( ‘name’ )); ?>
<?php if ($modality_theme_options[‘enable_logo_tagline’] == ‘1’ ) { ?>
<h5 class=”site-description”><?php echo esc_attr(bloginfo(‘description’)); ?></h5>
<?php } ?>
<?php } ?>
</div>
<div class=”navbar-header”>
<button type=”button” class=”navbar-toggle collapsed” data-toggle=”collapse” data-target=”#navbar” aria-expanded=”false” aria-controls=”navbar”>
<span class=”sr-only”>Toggle navigation</span>
<span class=”icon-bar”></span>
<span class=”icon-bar”></span>
<span class=”icon-bar”></span>
</button>
</div><!–navbar-header–>
<form role=”search” method=”get” class=”search-form” action=”https://hersheylibrary.org/”>
<div id=”navbar” class=”navbar-collapse collapse”>
<?php
if (has_nav_menu(‘main_navigation’)) {$modality_default_menu = array(
‘theme_location’ => ‘main_navigation’,
‘menu’ => ‘main_navigation’,
‘depth’ => 0,
‘container’ => false,
‘menu_class’ => ‘nav navbar-nav’,
‘fallback_cb’ => ‘wp_page_menu’,
‘walker’ => new wp_bootstrap_navwalker(),
);} else {
$modality_default_menu = array(
‘theme_location’ => ‘main_navigation’,
‘menu’ => ‘main_navigation’,
‘depth’ => 0,
‘container’ => false,
‘menu_class’ => ‘nav-bar’,
‘fallback_cb’ => ‘wp_page_menu’,
);}
wp_nav_menu( $modality_default_menu );
?>
<?php get_search_form(); ?>
</div><!–/.nav-collapse –></nav>
</div><!–header-wrap–>
</div><!–header-holder–>Forum: Fixing WordPress
In reply to: How to move search boxEither I am foolish, or something spooky happened because I swear I could not find this “<form role=”search” method=”get” class=”search-form” …
in the child theme header php this afernoon but now it is there above the line that starts “<div id=”navbar” class”navbar-collapse-collapse”>”
I am posting the entire header php. If you are willing to take a look and advise, I would be grateful.One piece of advice I was given from another WordPress moderator on a different topic but that involves the header was to copy the whole header php into the child theme editor. But if I select header php in the drop down box, make changes there and then save, does that have the same effect? I need to be super cautious and specifics are very helpful. Thanks.
The theme is backed up daily.
Forum: Fixing WordPress
In reply to: How to move search boxMy earlier attempt did not produce the proper result. I had duplicated the search box, resulting in a search box above the navigation bar; which is what I wanted, and one below; which I should have removed. I think I know how to proceed.
Thank you, Susuan for the clarification.Forum: Fixing WordPress
In reply to: How to add title to headerGosh, that looks very complex. I am confused as to why you say “for example”. Do you just mean change from this header php to this header php?
You can tell I am scared of deleting something critical! Should I copy all the original header php in the first section above into my child theme (2) and make the change in the child theme (1)?
Where exactly do I add HERSHEY PUBLIC LIBRARY?
Thanks for your help, Michael.
Forum: Fixing WordPress
In reply to: How to move search boxWow, I just did it, and the search box is now above the navigation bar. This is like magic! Is there anything else I should do to make the change stick because when I open a new window for the website the change has not applied. Is that because of browser cache?
Forum: Fixing WordPress
In reply to: How to move search boxI could not find “<form role=”search” method=”get” class=”search-form” …”in the header php of my child theme but did see it when I inspected the page element. I successfully found “<div id=”navbar” class”navbar-collapse-collapse”>” in the header php.
You suggested “copying” it and moving it. So, I entered the exact code from the page element “<form role=…” into the position you gave and in child theme header php. Then, added the css to the style sheet in the child theme. Nothing happened at all. What did I not understand or do wrong? Second thing I tried was to highlight the line in the web page Element Inspection. I tried to move the line that begins <form role…> above the line <div id=”navbar….” but that didn’t work.
The site looks as if it has not changed at all but could I have damaged something when trying to move those elements? You shouldn’t or can’t make changes to the Elements, right?
Thanks for your patience and willingness to help me.