- This topic has 40 replies, 4 voices, and was last updated 1 year, 1 month ago by
Fernando.
-
AuthorPosts
-
July 19, 2022 at 4:48 am #2287179
Sabbir
Hi,
I make the home page search bar like this (https://wow-company.com/knowledgecenter/)
You can check my current search bar here: https://www.disabilityresources.org/
July 19, 2022 at 6:43 am #2287270David
StaffCustomer SupportHi there,
Try this CSS, its not 100% but its similar.
.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper { border-radius: 50px; overflow: hidden; } .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__input { margin: 5px 15px; background-color: #fff; font-size: 25px; } .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__button { background-color: #fff; height: 50px; width: 50px; border-radius: 100%; box-shadow: -1px 3px 15px 0 rgba(0,0,0,0.06); } .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__button:hover { background-color: #000; }
July 19, 2022 at 6:55 am #2287285Sabbir
That’s good enough David, Thank you so much
one more thing,
can I make this page (https://www.disabilityresources.org/categories.html)? like the category page (https://www.disabilityresources.org/disabling-conditions-articles) design
July 19, 2022 at 7:03 am #2287291David
StaffCustomer SupportDo you meant the style of the list of links ?
July 19, 2022 at 7:06 am #2287294Sabbir
yes, it’s a page. I like to design the page like the category archive. or is there any way to make a link in the navigation to go all category list and it should be like category archive page.
July 19, 2022 at 7:14 am #2287300David
StaffCustomer SupportAre you manually adding the list of archive terms ?
As theres no automatic method of adding a list of all terms. But we can create a shortcode to display the list, and then style that. See here for the shortcode:
I can modify that and provide some CSS if that works for you?
Let us know if you want to keep the Post Count for the terms and the Description.July 19, 2022 at 7:22 am #2287307Sabbir
Its works, (https://www.disabilityresources.org/cat.html)
maybe if you modify the code for me, it will be the same as I want.
July 19, 2022 at 9:19 am #2287594David
StaffCustomer SupportTry this PHP Snippet for your shortcode:
add_shortcode('cat_listing', function($html){ $categories = get_categories(); $html = '<div class="category-term-list">'; foreach( $categories as $category ) { $category_link = sprintf( '<a class="term-links" href="%1$s" alt="%2$s">%3$s</a>', esc_url( get_category_link( $category->term_id ) ), esc_attr( $category->name ), esc_html( $category->name ) ); $html .= '<h2 class="term-title entry-title">' . $category_link . '</h2>'; } $html .= '</div>'; return $html; });
Then add this CSS:
.category-term-list .term-title { border-bottom: solid 1px #dedede; padding-bottom: 20px; margin-bottom: 20px; }
July 19, 2022 at 9:24 am #2287598Sabbir
looks good, I need the title/link bold and right arrow like this https://prnt.sc/hJfzNMsKbxIb
July 19, 2022 at 9:28 am #2287603David
StaffCustomer Supporthmmm… odd the HTML being produced includes some unwanted
code
tags.
Try changing the PHP Snippet to this:add_shortcode('cat_listing', function($html){ $categories = get_categories(); $cat_html = '<div class="category-term-list">'; foreach( $categories as $category ) { $cat_html .= sprintf( '<h2 class="term-title entry-title"><a class="term-links" href="%1$s" alt="%2$s">%3$s</a></h2>', esc_url( get_category_link( $category->term_id ) ), esc_attr( $category->name ), esc_html( $category->name ) ); } $cat_html .= '</div>'; return $cat_html; });
July 19, 2022 at 9:31 am #2287608Sabbir
no changes
July 19, 2022 at 10:20 am #2287651Ying
StaffCustomer SupportThat’s very weird, the
<code>
tag is still there.Can you try disabling all your plugins to test? There might be a plugin that adds this.
July 19, 2022 at 10:26 am #2287656Sabbir
here is my all custom CSS, Should I organize these?
.archive .entry-summary, .archive .entry-meta {
display: none;
}
.category main#main > article {
border-bottom: solid 1px #dedede;
padding-bottom: 20px;
position: relative;
}.category main#main > article:after {
color: #777;
content: “\2192”;
font-weight: 300;
font-size: 20px;
position: absolute;
top: 0;
right: 0;
}.category input#wp-block-search__input-1 {
border-radius: 30px;
}.category nav#nav-below .nav-links > a {
border: solid 1px black;
border-radius: 4px;
background-color: black;
color: white;
padding: 2px 5px;
margin: 0 4px;
}.category nav#nav-below .nav-links span.page-numbers.current {
border: solid 1px black;
border-radius: 4px;
background-color: white;
color: black;
padding: 2px 5px;
margin: 0 4px;
}.category nav#nav-below .next > span, .category nav#nav-below .previous > span {
display:none;
}.category nav#nav-below .nav-links {
width: 100%;
display: flex;
justify-content: center;
position: relative;
}.category nav#nav-below .next {
position:absolute;
right:0;
top:0;
}.category nav#nav-below .previous {
position:absolute;
left:0;
top:0;
}h4, h5, h6 {
margin-bottom: 0px;
}.search .entry-summary {
margin-top: 0;
}.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper {
border-radius: 50px;
overflow: hidden;
}.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__input {
margin: 5px 15px;
background-color: #fff;
font-size: 25px;
}
.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__button {
background-color: #fff;
height: 50px;
width: 50px;
border-radius: 100%;
box-shadow: -1px 3px 15px 0 rgba(0,0,0,0.06);
}
.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__button:hover {
background-color: #8FBCBB;
}.category-term-list .term-title {
border-bottom: solid 1px #dedede;
padding-bottom: 20px;
margin-bottom: 20px;
}July 19, 2022 at 10:31 am #2287663Sabbir
I have also tried disabled plugins.
July 19, 2022 at 11:34 am #2287711Ying
StaffCustomer SupportThe issue is not related to CSS.
Do you have any custom functions added to your site?
-
AuthorPosts
- You must be logged in to reply to this topic.