May 2, 201115 yr Hi All, I am doing my first Wordpress theme and am running into a lot of little things that I am nt sure how to do so i thought I would put them all into this post: 1. How do I create a page and not have it showing in the main navigation? 2. How can I make it that the Wordpress WYSIWYG is not adding HTML SPAN tags to the content? 3. What is the best way to make a link point to a specific page in wordpress tags? Instead of direct link? Thanks
May 2, 201115 yr If you want to exclude certain pages I'm sure there is an exclude argument for the wp_list_pages. I'm sure this would only exclude certain pages though and every time you created a new page you'd have to alter the code so probably not the best way. Maybe there is a plugin?
May 2, 201115 yr Author 1. How do I create a page and not have it showing in the main navigation? Found this out: Added the following to the Nav tags: 'exclude'=> '95,104', <?php wp_nav_menu( array( 'exclude'=> '95,104', 'sort_column' => 'menu_order', 'menu_class' => 'nav', 'theme_location' => 'primary-menu' ) ); ?> I have another Question: 4. What code do I add to certain areas of my theme files in order to get plugins / widgets to display there? Thanks
May 2, 201115 yr Author If you want to exclude certain pages I'm sure there is an exclude argument for the wp_list_pages. I'm sure this would only exclude certain pages though and every time you created a new page you'd have to alter the code so probably not the best way. Maybe there is a plugin? Thanks for the tip
May 4, 201115 yr Hello! This step-by-step tutorial (themetation dot com/2008/07/14/how-to-create-wordpress-themes-from-scratch-part-1/) really helped when I made my first from-scratch theme. It lists and defines all Wordpress required pages and even discusses image slicing for your page layout. It's a few pages long but just keep at it. You'll have a working theme if you'll just follow the steps. Good luck! Edited May 4, 201115 yr by commonzen
May 4, 201115 yr Hi All, I am doing my first Wordpress theme and am running into a lot of little things that I am nt sure how to do so i thought I would put them all into this post: 1. How do I create a page and not have it showing in the main navigation? 2. How can I make it that the Wordpress WYSIWYG is not adding HTML SPAN tags to the content? 3. What is the best way to make a link point to a specific page in wordpress tags? Instead of direct link? Thanks 1. Define your navigation as a WP3 custom menu. That makes adding pages opt-in. 2. Where's it adding spans? 3. How d'you mean? You can add internal links in the WYSIWYG dialogue as of WP3, not sure if it's persistent through a change of permalink structure though. 4. functions.php: function yourtheme_widgets_init() { register_sidebar( array( 'name' => __('Primary Widget Area', 'yourtheme'), 'id' => 'primary-widget-area', 'description' => __('The primary widget area', 'yourtheme'), 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // Repeat the above for each widget area } add_action('widgets_init', 'yourtheme_widgets_init'); In your template: <ul class="xoxo"> <?php if(!dynamic_sidebar('primary-widget-area')) : ?> <!-- Default content for when no widgets are found in the sidebar goes here --> <?php endif; ?> </ul> Edited May 4, 201115 yr by Renaissance-Design
May 5, 201115 yr Author 1. Define your navigation as a WP3 custom menu. That makes adding pages opt-in. 2. Where's it adding spans? 3. How d'you mean? You can add internal links in the WYSIWYG dialogue as of WP3, not sure if it's persistent through a change of permalink structure though. 4. functions.php: function yourtheme_widgets_init() { register_sidebar( array( 'name' => __('Primary Widget Area', 'yourtheme'), 'id' => 'primary-widget-area', 'description' => __('The primary widget area', 'yourtheme'), 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // Repeat the above for each widget area } add_action('widgets_init', 'yourtheme_widgets_init'); In your template: <ul class="xoxo"> <?php if(!dynamic_sidebar('primary-widget-area')) : ?> <!-- Default content for when no widgets are found in the sidebar goes here --> <?php endif; ?> </ul> Thanks dude, helps a lot
May 7, 201115 yr Author Hey Guys, I'm still not sure how I can now show the 2 pages that I excluded elsewhere. Any ideas how I can use wp_list to display only 2 pages ? Thanks
May 7, 201115 yr Author Im also having issues with my test wordpress now: I get the following error when trying to access the /wp-admin/ (backend) Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/domain.com/wp-content/themes/New 3.0 Theme/functions.php:25) in /var/www/vhosts/domain.com/wp-includes/pluggable.php on line 897 What does this mean?? Hope someone can help me. Thanks
May 9, 201115 yr Author Im also having issues with my test wordpress now: I get the following error when trying to access the /wp-admin/ (backend) Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/domain.com/wp-content/themes/New 3.0 Theme/functions.php:25) in /var/www/vhosts/domain.com/wp-includes/pluggable.php on line 897 What does this mean?? Hope someone can help me. Thanks Anyone Had this before?
May 9, 201115 yr Double check your themes functions file for blank spaces at the start of the file. Also check in wp-config too. if there are blank lines/spaces then remove them.
May 10, 201115 yr Author Double check your themes functions file for blank spaces at the start of the file. Also check in wp-config too. if there are blank lines/spaces then remove them. Thanks dude, will try this tonight as Its driving me crazy. I know it was after I edited something on the theme. Im also not able to see the header image anymore which is wierd. I need to complete the theme by the end of the week also
May 10, 201115 yr Anyone Had this before? Hey mate, yeah I've had the exact same message previously, drove me crazy. When you last made an edit to the code, you may of accidentally deleted or changed a line of code. Did you make a backup before changing the code? I strongly advise this with Wordpress because I've seen that a couple of times but was able to revert straight back with the backed up code. Let us know how you get on. I started with Wordpress a couple of months ago but I know it quite well now.
May 10, 201115 yr Thanks dude, will try this tonight as Its driving me crazy. I know it was after I edited something on the theme. Im also not able to see the header image anymore which is wierd. I need to complete the theme by the end of the week also Try adding ob_start(); at the start of your functions.php and that should temporarily stop the error and get you back into the Control Panel. Don't suppose you remember what the last file you edited was before the error appeared?
May 11, 201115 yr Author Try adding ob_start(); at the start of your functions.php and that should temporarily stop the error and get you back into the Control Panel. Don't suppose you remember what the last file you edited was before the error appeared? I have no idea what file I last made edits too I usually have a few of the pages open in notepad ++ and just edit and preview at the same time I will try adding that at the start and comparing the files to another theme. I dont make backup copies of my code so I have no way of reverting it. Damn.
May 11, 201115 yr All it was for me was blank spaces at the beginning (or possibly end) of a couple of files. Start with the functions.php file and delete anything before the opening <? and anything after the closing ?> Then try the same with the wp-config.php, if no luck continue with the rest of the theme files. Shouldn't take you more than 5 minuets.
May 12, 201115 yr Author Hey all, I have checked the functions file etc and still getting the issue of the header image not displaying now This is the code I am using in the header file: <p><a href="<?php echo get_option('home'); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/header2.jpg" alt="<?php bloginfo('name'); ?>" name="logo" width="960" height="272" /></a></p> Would this not work If i have selected a theme to use in the backend on the pages options??
May 12, 201115 yr Have you tried typing out the full directory for where the image is rather than using the <?php bloginfo('template_directory'); ?> ? I don't know but it may be worth trying
May 12, 201115 yr Hey all, I have checked the functions file etc and still getting the issue of the header image not displaying now This is the code I am using in the header file: <p><a href="<?php echo get_option('home'); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/header2.jpg" alt="<?php bloginfo('name'); ?>" name="logo" width="960" height="272" /></a></p> Would this not work If i have selected a theme to use in the backend on the pages options?? That code looks fine to me. You got a test link to have a look at Tony? Edited May 12, 201115 yr by MikeChipshop
May 12, 201115 yr I have no idea what file I last made edits too I usually have a few of the pages open in notepad ++ and just edit and preview at the same time I will try adding that at the start and comparing the files to another theme. I dont make backup copies of my code so I have no way of reverting it. Damn. Windows Previous Versions? It can occasionally rescue things. Failing that, store your projects in Dropbox for 30 days' versioning (previous versions don't count toward your storage quota) - plus you can access your files from anywhere, so if you forget something and you're at the client's, you can log in through the web interface and download your files. It'll also sync them between your different machines (and even your phone if you want). I'll be writing up a guide soon on my blog on how to set up a bulletproof development environment on Windows, I'll give you a shout as soon as I've done that. Edited May 12, 201115 yr by Renaissance-Design
May 12, 201115 yr Author Have you tried typing out the full directory for where the image is rather than using the <?php bloginfo('template_directory'); ?> ? I don't know but it may be worth trying This worked fine for the whole development, I haven't touched it
May 12, 201115 yr Author Windows Previous Versions? It can occasionally rescue things. Failing that, store your projects in Dropbox for 30 days' versioning (previous versions don't count toward your storage quota) - plus you can access your files from anywhere, so if you forget something and you're at the client's, you can log in through the web interface and download your files. It'll also sync them between your different machines (and even your phone if you want). I'll be writing up a guide soon on my blog on how to set up a bulletproof development environment on Windows, I'll give you a shout as soon as I've done that. That would be cool
May 12, 201115 yr Author That code looks fine to me. You got a test link to have a look at Tony? My link Edited May 12, 201115 yr by ayoungh
May 22, 201115 yr Author Has anyone else had an issue with there custom theme once they have upgraded. My header image wont load anymore. I think its due to me upgrading the wordpress install? Can anyone help me with this? My code is looking like the following: <a href="<?php echo get_option('home'); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/header2.jpg" alt="<?php bloginfo('name'); ?>" name="logo" width="960" height="272" /> My link
May 22, 201115 yr You've got links to these JS files just above your footer: <script type="text/javascript" src="scripts/jquery-1.4.3.min.js"></script> <script type="text/javascript" src="../jquery.nivo.slider.pack.js"></script> Both of them are 404 pages so check to see if the files exist or are at different locations.
May 23, 201115 yr Author You've got links to these JS files just above your footer: <script type="text/javascript" src="scripts/jquery-1.4.3.min.js"></script> <script type="text/javascript" src="../jquery.nivo.slider.pack.js"></script> Both of them are 404 pages so check to see if the files exist or are at different locations. What do you mean?
May 23, 201115 yr Author Its working tho? I will check why I have that bit fo code in there when I get home tonight. hmm? Would that effect the static header image?
May 24, 201115 yr Author I just found out that the header stopped showing due to the file name having a capital H. why would this suddenly make a difference? It worked before and im sure I didnt change it. :s
May 24, 201115 yr Worked before on your local box but didn't when you uploaded it? Linux filesystem is case-sensitive; Windows isn't.
Create an account or sign in to comment