Wordpress Theme Development Quick Start - wordpress

I tried looking for a quick and dirty getting started with wordpress theme development tutorial. Now I know how to go and discover things myself, I'm looking for "top ten FAQ for programmers" when starting wordpress development. (For example, Turn on debugging and where the debugging option is located), how best to setup your dev environment.
All I can find is elaborate or too low level or too high level guides to it. Coming from a background of creating custom wordpress-like applications makes me frustrated.
So perhaps someone can list of the few things I need. I don't need to know how wordpress works, what a database or widget or page is.
Question I was specifically searching for:
1. How do I make wordpress watch the theme folder for changes from my IDE ( I can't really believe anybody would develop through the wordpress admin theme editor...No Undo history!). Changing the files doesn't seem to take affect until I re-install the theme. Debug mode needs to be true?
Any links condensed version of this: http://codex.wordpress.org/Theme_Development or similar?

WordPress use a hierarchy of files to determine what ends up being shown to the user. For starters all you need to create a WordPress theme is a style.css and index.php.
This is what you will have to put in your style.css in order to make it a valid WordPress theme:
/*
Theme Name: Your theme name
Theme URI: http://www.example.com/
Description: Describe your theme.
Author: Your name or company
Author URI: http://www.example.com/
Version: 1.0
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu (optional)
License:
License URI:
General comments (optional).
*/
All you really need to include is a unique name for your theme and WordPress will recognize it and list it among your other themes. Even though that works, I would recommend including as much info as possible.
With just two files, index.php will then run for every single page view, no matter the type of content the user asks for. You can extend this by adding files like page.php to display all your pages, single.php to display single posts differently and so on.
I highly recommend getting familiar with the WordPress Codex. This is a good place to start:
http://codex.wordpress.org/Template_Hierarchy
The image below explains the hierarchy and what file ends up being served. I use it sometimes for reference, there is no need to memorize it entirely.

you need to become familiar with basic wordpress functions like the_permalink, the_title, the_content, etc. these are easy to remember and you can always refer to wordpress.org documentation if you don't want any out of box functionality and you pay more attention to design
if you intend to submit theme to wordpress.org than turn on debugging wile developing and read this before start http://codex.wordpress.org/Theme_Review

Theme development for beginners can be made easier by basing it on an existing theme such as the twentytwelve theme. I have written a blog post on it here http://johnadavies.me/2013/09/19/wordpress-child-theme-development/
John

turning on debugging it's the root-directory config-file.php look for faction call in
// Enable WP_DEBUG mode
define('WP_DEBUG', true);

Related

Applying a different Wordpress Template to a different wordpress theme

I purchased a wordpress theme as shown in the url here https://seosight.crumina.net/. Since then i have changed my mind and browsed for ready made templates and happy with the template located here https://themes.semicolonweb.com/html/canvas/demo-seo.html
However, since i purchased the theme, can i buy and push the templates in the existing themes with minimal work or do i need a wordpress developer?
The short answer: no, you can't.
The themes aren't only a PHP template. The also have css and JavaScript files. And also some php custom functions.
The best way to replicate the page you like is with a designer, like Elementor, Divi, Oxygen, etc. Or better yet, with a developer :)

WordPress theme Update

I have uploaded a theme on WordPress repository but review pointed out some issues in the theme.
I have fixed all these issues and updated my theme version. Then WordPress gave me another ticket number.
But it is not being updated or the last five days.
Can anyone tell me what is the problem and solution
The page I need help with: https://themes.trac.wordpress.org/ticket/83941
Thanks.
Welcome to Stack Overflow! Unforunatelly this is not the right place for this specific question. Please read https://stackoverflow.com/help/how-to-ask and https://stackoverflow.com/help/minimal-reproducible-example
But not to let you down, I looked in your ticket link:
More than one text-domain is being used in this theme. This means the theme will not be compatible with WordPress.org language packs. The domains found are storeluda, tgmpa
Invalid theme URI. There is no any information about the theme.
Copy of underscores theme. Copyright (C) 2020 Automattic
License issues, pixabay images are not allowed.
Do you have any troubles and don't know how to solve this requirements?
You can show us some code if you think you have done everything right.
If you don't know what to do:
In your functions.php or anywhere in your theme you are using more than one text domain. This might help: https://developer.wordpress.org/themes/functionality/internationalization/#text-domain Only use one text domain for your theme.
You theme uri is a public webpage where users can find out more information about the theme.
So the style.css of your theme should start with something like:
/*
Theme Name: Twenty Seventeen
Theme URI: https://wordpress.org/themes/twentyseventeen/
Author: the WordPress team
Author URI: https://wordpress.org/
Description: Twenty Seventeen brings your site to life with immersive featured images and subtle animations. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentyseventeen
Tags: one-column, two-columns, right-sidebar, flexible-header, accessibility-ready, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/
Find out more: https://developer.wordpress.org/themes/basics/main-stylesheet-style-css/
You are using Underscore_s starter theme and build your theme above it. You should make this clear in your themes information.
You are also using images that are the property of someone else. Obviously you cannot use pixabay images, as they say "are not allowed". Take a look at licence free images and get a licence for the images to duplicate and sell them.
Hope this can help you.

Wordress - How to work with non wordpress theme

I'm new to wordpress, and I want to know if it is possible to put a theme bought on shapedtheme.com for example on an existing wordpress.
And if so, how to do it. I don't know where to put the code of the theme. I saw the wordpress page builder with text, but I see tags with [] and not <>.
I saw on this thread that pages can be linked to php files. I don't see how.
I have full access to the hosting service's filesystem and can see all wordpress files.
I would also like to transpose the theme header and footer and if possible, use the theme cards to adapt to blog articles written in wordpress.
How can I do this ?
I searched for tutorials on google or related threads on SO with no luck.
Any ressource would be appreciated.
Thanks to anyone who will take the time to read/answer this post.
No, you can't use a non-WordPress theme in a WordPress installation since WordPress will look for specific templates and pass certain objects to the template to be displayed.
You could adapt it to work with WordPress, though. Here's the theming guide to get you started.
But you'll probably be able to find a WordPress-ready theme with the features you want. This is the WordPress theme directory link for themes using bootstrap.
Unless you go for a from-scratch development of a pure php theme, and you need some level of theme customization I'd strongly suggest looking into child themes, as it'll allow you to update the base theme minimizing the changes you'd have to do to yours.
The [ ] syntax you mention are shortcodes, small, safe php functions that can be executed by inserting them in the editor, templates, etc, and provide kind of an api that exposes WordPress or plugins functionality.
And regarding your link, OP already has a WordPress theme, but is looking for a way of using a different, specialized template on specific pages. This template still has to follow to certain WordPress conventions.

Modifying a WordPress theme

I am in the process of heavily customising a WordPress theme. The theme is quite complex so it is hard for me to identify how and where data is rendered from all the different files in the theme.
Is there a plugin for a browser which tells me what file in the theme a specific element is generated from?
please have a look at these plugins.
It will definitely help you.
[1] http://wordpress.org/extend/plugins/debug-bar/
[2] http://wordpress.org/plugins/debug-bar-template-trace/
Just install in your theme, and go to the page and trace it through this plugin, it will show you, from which file's code is executing right now...
Thanks.
The thing you'll find most useful, or at least the thing I've always found most useful, is the Wordpress template hierarchy.
It's a graphic that shows which files Wordpress will attempt to find to render a page of the site, for instance when showing a page, rather than a post, wordpress looks for a file called page-{id}.php (where {id} is the numerical id of the page) first, then page-{slug}.php, then page.php then index.php.
Using the hierarchy flow diagram, you can see which files Wordpress would try and in what order, and by comparing this to the files in your theme, you can quickly track down which file it is.
http://codex.wordpress.org/Template_Hierarchy - Scroll down to the image, it's the most useful bit.

Wordpress, how to start with an empty theme?

I have been working on Wordpress for a month creating themes. Otherwise, when I'm starting a new project, I'm always starting with an existing theme that I am modifying.
What I want, is to clean perfectly a theme and add to it what I need for the website.
But, my Wordpress knowledge aren't enough to do it. So, I'm asking you if you know a great book, website etc, where they are explaining simply how to create a new theme (understand every features of Wordpress, explaining every functions in the functions.php file, how to add correctly Wordpress post content).
Thanks
Romain asked:
...how to create a new theme (understand every features of Wordpress,
explaining every functions in the functions.php file, how to add
correctly Wordpress post content).
Start with the codex http://codex.wordpress.org/Main_Page which is
the online manual for WordPress and a living repository for WordPress
information and documentation.
What I did was create all the files and save them in a folder, then upload them as needed. I copied them from this simple tutorial and although says its to create a designed theme, it has nothing but basic blank theme:
http://blog.spoongraphics.co.uk/tutorials/how-to-build-a-custom-wordpress-theme-from-scratch
You can download simplest possible theme for wordpress here:
http://wordpress.org/extend/themes/simplest
After you take a look at this and create some theme using this simple theme - you will better understand Wordpress Codex, and you can follow #markratledge suggestions about Codex.
Anyway, I decided to not read whole codex and im using this theme ("Simplest") as boilerplate for my themes.
You should check out Starkers by Elliot Jay Stocks:
Intro: http://viewportindustries.com/products/starkers/
Demo: http://starkers.viewportindustries.com/
Github: https://github.com/viewportindustries/starkers
It helped me out a bunch of times to start from scratch. It has the basic files and no CSS.
the wordpress.org will be your best starting point, for your
(understand every features of Wordpress, explaining every functions in the functions.php file, how to add correctly Wordpress post content).
You can make WordPress themes from the scratch by following some methods
By using Youtube, but that'll be not very professional
By using Google, yes you will find many sites that will show you the process and this is efficient and free
By using Udemy or Lynda, you will learn about the whole process with the necessary knowledge like the hierarchy of wordpress, tools & standards for wordpress etc.
By using wordpress.org, this is most desirable and professional way of learning wordpress as this is the main place for all the things happening around the WordPress.

Resources