Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Many times, while developing Wordpress plug-ins, themes or widgets, we use unnecessary lines of code and logic.
As the time goes we find and get better solutions for same logic which is tidy, simple and good in performance.
Here I would like to know such Tips & Tricks, that makes our wordpress development life simple and enjoyable.
(I will also add some of my Tips & Tricks here.)
Including javascript :
To include javascript in wordpress plugin,normally we use
wp_enqueue_script('PATH_TO_JAVASCRIPT');
But this include javascript in both front side and admin side of site, if that plugin is active.
If you want to activate it on only admin side use
if(is_admin()){
wp_enqueue_script('PATH_TO_JAVASCRIPT');
}
2 . Using wordpress classes, objects, functions outside wordpress:
To use wordpress classes, objects, functions outside wordpress, simple include wp-load.php file in your script
<?php include_once 'wp-load.php';?>
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
if you will need to strip all default css in a wordpress theme is it easiest to just create a new theme from scratch or a child theme? for instance if I were to be making a custom blog would it be easiest to use canvas as the parent theme? Or would I be better off creating a new theme from scratch. I have experience in frontend development but I haven't ever worked with theming in wordpress.
The best thing is to start from a raw theme.
I've been using Bare Bones several times ( http://themble.com/bones/ ).
As they say: Keep what you need, remove what you don't. It's totally up to you.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I want to be a wordpress theme developer.
I already know HTML,CSS,PHP,MYsql very clearly.
I know how to run a blog with wordpress.
So,what should i learn now.?Please suggest me?
First you need to understand the basic structure and file higher key of any standard wordpress theme like twenty twelve . Then try to make child theme based on it. You can see this link http://www.elegantthemes.com/blog/resources/wordpress-child-theme-tutorial .
Once you are okay with child theme development you can take approach to build wordpress theme .
If you want to build theme from a html then you can also see this link http://code.tutsplus.com/tutorials/creating-a-wordpress-theme-from-static-html-creating-template-files--wp-33939
Take a look at this page http://codex.wordpress.org/Theme_Development
It explains how you develop a wordpress theme from scratch. It's free to publish at theme at no cost. Take a look at the fundamentals of wordpress theme development http://line25.com/articles/15-tutorials-to-help-you-build-wordpress-themes. These arte just a bunch of tutorials to help users create modern themes since that is the key to popularity, I believe.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Alright, Im in the process of creating a custom wordpress theme.
My index page is getting super crowded with code so im wondering..
If i were to create an additional page.. say, "topplayers.php"
would I be able to load that into the position where I want it to appear on my index page?
Try looking into php includes. I'm not too familiar with wordpress themes when it comes to their creation but something like:
<?php include('path/to/file.php'); ?>
Should provide the functionality your after.
If it is integral to the site - i.e if its not there the site shouldn't load, you can use require instead of include.
Sure you can make an include.
http://php.net/manual/en/function.include.php
One cool way of doing it (if you place the file in your wordpress directory) is this way:
<?php include(get_template_directory() . 'topplayers.php'); ?>
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
On one of my websites, the editor and subscriber have access to Dashboard, Profile and Plugins. This is really strange. There is no access to anything else - pages, posts etc.
Have tried re-installing wordpress and makes no difference.
Not using any user access plugins
Any help would be greatly appreciated!
Chris
You should test the capabilities of your users and re structure them accordingly. Have a look at The Codex to get a list of capabilities for editors and subscribers.
If you want to use plugins, you can find some that will allow you to edit the capabilities.
else you can then use get_role(), add_cap() and remove_cap() to correct their capabilities.
You should switch to a standard theme such as twenty twelve and see if it woks properly, of it does the problem is your theme and you should contact the theme author.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed last year.
Improve this question
Regarding Wordpress:
Is it best practice to distribute a functions.php file (to be stuck in a WP theme) filled with helpful functions, or distribute a plugin for wordpress that enables these functions anywhere?
it depends. It depends on how coupled those functions are with the theme itself. If the functions are only useful for that theme, or you don't plan on making a lot of themes, just leave them in the functions.php file. If the functions are more general, and you could see yourself or someone else wanting to use them in other themes, you may want to make them a plugin.
Some basic ideas about the use of functions.php files in Theme Development at WP.