Jonas_
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Adding thumbnail image to each categorynote: i meant category-template.php instead of general-template.php
Forum: Fixing WordPress
In reply to: Adding thumbnail image to each categorycan you just copy the code from general-template.php into functions.php? or does this gives errors without changing anything?
Forum: Fixing WordPress
In reply to: Adding thumbnail image to each categoryi currently have
<?php foreach(get_categories() as $category) { echo '<img src="https://.../images/' . $category->cat_name . '.jpg" alt="' . $category->cat_name . '" />'; } ?>
but this only shows my images.. i think im doing it right or not?
i now need to echo the cat_name with a link to it and put them in a list and then it should work fine ??BUT can’t i just add this code so its added to the default template?
i tried copying the code from general-template.php and paste it in functions.php and adding the image code to it and then i did aadd_action( 'wp_list_categories', 'wp_list_categories_test' );
but it didn’t work.. in fact my page didn’t display anymore ??
although i think this is THE WAY TO GO?Forum: Fixing WordPress
In reply to: changing the search formi found the problem: file rights where incorrect lol ??
thanks everyone for the help!
Forum: Fixing WordPress
In reply to: changing the search formyep here it is: https://pastebin.com/rCJ2ySDn
some1 also suggested adding: but that didn’t help neither…
function my_search_form( $form ) { $form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" > <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label> <input type="text" value="' . get_search_query() . '" name="s" id="s" /> <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" /> </div> </form>'; return $form; } add_filter( 'get_search_form', 'my_search_form' );
is it possible i miss some configurations in my functions.php maybe because im starting from a very basic template so i can learn it more easy ??
Forum: Fixing WordPress
In reply to: changing the search formokay, if i paste my content from searchform.php straight into my header.php IT WORKS FINE.. so this is a php error? or wordpress 3.1 bug?
Forum: Fixing WordPress
In reply to: changing the search formsorry for the confusion but i’ve deleted all references for a sidebar now. wordpress says i need one before i can widgets and i have no calls to get_sidebar.
So now im just trying to get my search form shown.. it doesn’t matter where, i thought i just put it in the header and see if it shows up or not.. but it doesn’t show up and now im clueless what the real problem is
so this is my code:
header.php<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> <title>TITLE</title> <link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('template_directory'); ?>/style.css" /> <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> <?php wp_head(); ?> </head> <body> <!-- Page beginning--><div id="page"> <!-- Inside beginning--><div id="inside"> <!--Header--> <div id="header"> <p> test123</p> <a href="<?php bloginfo('url'); ?>">Hallo</a> </div> <div id="searchform"> <?php get_search_form(); ?> </div> <ul id="nav"> <li><a href="<?php echo get_option('home'); ?>/" class="on">Home</a></li> <?php wp_list_pages('title_li='); ?> <li class="cat-item"><a href="#">Categories</a> <ul class="children"> <?php wp_list_categories('orderby=name&title_li='); $this_category = get_category($cat); if (get_category_children($this_category->cat_ID) != "") { echo "<ul>"; wp_list_categories('orderby=id&show_count=0&title_li= &use_desc_for_title=1&child_of='.$this_category->cat_ID); echo "</ul>"; } ?> </ul> </li> </ul> <!--End header-->
searchform.php:
<form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>"> <div><label class="screen-reader-text" for="s">Search for:</label> <input type="text" value="" name="s" id="s" /> <input type="submit" id="searchsubmit" value="Search" /> </div> </form>
Forum: Fixing WordPress
In reply to: changing the search formnope it isn’t i currently have the following:
header.php:
<!--Header--> <div id="header"> <a href="<?php bloginfo('url'); ?>">Hallo</a> </div> <div id="searchform"> <?php get_search_form(); ?> </div> <ul id="nav">...</div>
searchform.php:
<form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>"> <div><label class="screen-reader-text" for="s">Search for:</label> <input type="text" value="" name="s" id="s" /> <input type="submit" id="searchsubmit" value="Search" /> </div> </form>
BUT the strange thing is that my source code STOPS after
<div id="searchform">
so what is wrong???thanks in advance!
Forum: Fixing WordPress
In reply to: changing the search formany1???
Forum: Fixing WordPress
In reply to: changing the search formsome1?
ok thanks we probally will use plugins