Add custom content to a wordpress theme template - php

I'm in the process of customising a theme (styling, css, etc). However, I ran into a small problem, basically I wan't to include an introductory message at the top of the home/index template, and then have it as an option(text area) in the theme options panel. How do I go about doing this. Sorry for the noobish question, haven't found any straightforward solution yet. Thanks.

This is a significant customization that will require changes to the PHP code for the theme. You need a PHP programmer, preferably one who knows WordPress.

Related

Can I use HTML based theme in wordpress

I've been trying to create different themes in wordpress but it seems difficult to me as it requires some core functions of Php which I am unable to understand. Now I want to ask the question in details whether we can convert HTML theme to wordpress theme? I know that every theme is made in HTML but what If I make a theme in HTML/CSS or even bootstrap. How to integrate it with wordpress Posts and Pages thing? How can I tell wordpress that when a user adds a post through wordpress, it should go here or wherever? I think the question is vague but I myself is confused. Please do let me know if you understood! Thanks
You will need a combination of PHP, HTML, and CSS (at the least) to create a WordPress theme. Luckily, the PHP requried for a basic theme is pretty simple. I'd like to refer you to: https://www.siteground.com/tutorials/wordpress/wordpress_create_theme.htm . It gives a basic overview on theme development where the PHP isn't too involved.

How to add custom div (+php) code to wordpress site

I am very new to wordpress. But have good knowledge in php, html, css and javascript.
I want to add custom font-resizer to my wordpress site. as shown below for example.
What would be the best and non-messy way to add the plugin code to my website.
I have looked at some tutorials online but it seems that I can't getting those.
Any help would be appreciated. thank you..
If you're trying to add that plugin specifically to your site, then its documentation suggests:
adding it through a widget that the plugin creates
or using this bit of code wherever you want in whichever template file: <?php if(function_exists('fontResizer_place')) { fontResizer_place(); } ?>
Does your theme have a place for widgets in its header? If not, you'll want to just place that bit of PHP somewhere in your header.php file.

How can I make a customizeable widget area?

I know that I can go and change my theme's style.css file to change the background color of my widget areas, or if I make a custom widget area, I can give that a specific class and thus a custom background image in the style.css, but I need to give the user control for a few widget areas.
I have searched and searched and have not found any relevant information. Does anybody have any idea how I could do this? I really don't know how to make a widget AREA customizeable, and I would really appreciate any pointers in the right direction or assistance that anyone can provide.
EDIT
To be clear, I know how to add a custom widget area to my site. I have no idea how to add a customizeable option to the widget area, rather than a custom widget. As far as I understand it, widget areas are a set thing, are they not? Any pointer to a theme that does this would be greatly appreciated, as all of my google searches only end up pointing me to how to create a custom widget area, rather than a customizeable widget area.
Check the following two links if it is helpful for you.
http://theme.fm/2011/06/tutorial-creating-a-twitter-widget-for-wordpress-91/
http://wp.tutsplus.com/tutorials/creative-coding/building-custom-wordpress-widgets/
My understanding of your question is that you are looking for a way to allow the client/admin to modify the widgets that are displayed on any given page/post (rather than modify the widgets themselves).
This is a problem I have tried various ways to solve, never adequately imo. First of all there's the option to create a widget area for each page dynamically. I've seen it in commercial themes, I've done it myself, it is not without it's problems as you can see here - Register new widget position moves existing widgets
There are plugins that can do this, again not without their drawbacks. This plugin;
http://www.codeandmore.com/products/wordpress-plugins/wp-page-widget/
http://wordpress.org/plugins/wp-page-widget/
Is great, I love it. BUT it does not work on custom page template, be aware (I've not looked at modifying to allow this, I've seen a post by the developers saying they have no intention of adding this).
There is this plugin - http://strategy11.com/display-widgets/ by the developer of the Formidable plugin, for me it makes the widget area far too complex if you have a lot of widgets and a lot of pages.
Finally there is what I ended up doing recently - using this code by Chris Coyier
http://digwp.com/2010/04/call-widget-with-shortcode/
To do my own custom code using the Wordpress function the_widget (http://codex.wordpress.org/Function_Reference/the_widget) to deploy certain widgets on a page by page basis.

How can I edit a default function on WordPress?

I should edit the dynamic_sidebar() function on wordpress (hiding some categories, editing the template).
Is it possible? I read "you need to edit the core", but I don't have understand where is this "core" :)
Never edit the core. The reason is that if you change the default behaviour, themes you install might not work and updates to the wordpress engine will break your changes.
To change the way your wordpress behaves, create a child theme. Then add a functions.php file and in it create a widget that has your desired behaviour.
You can also register a new type of sidebar and a page templates that shows only that type of sidebar.
See: http://codex.wordpress.org/Child_Themes and https://codex.wordpress.org/Function_Reference/register_sidebar_widget
Personally, you sound like your just starting out so I will give you some advice. Never edit the core.
It's tempting for a quick fix. Everyone has done it when they didn't know any better, but you have the opportunity to learn the right way.
Approach your problem logically. What are you trying to edit it for? Hiding some categories? Use the internal widget system in the CMS and take them off. Delete the categories, or hide them with CSS {display:none;}.
Good luck my young Padawan. I hope you take some advice and heed it well.
Best way is to probably make a Child template using the plugin One-click child theme. Copy the file containing the function to the child template (using ftp) and edit it there. This way you can update your template and still keep your changes.

Wordpress e-commerce theme conflict?

I have installed the shopp plugin for WordPress.
I have also purchased the FlexiShop theme (which is primarily for the wp e-commerce plugin).
The issue I'm having is with integrating the Flexishop theme with the shopp plugin. I know Flexishop was built for wp e-commerce, however, e-commerce is limited in its functionality, which is why I have now gone with shopp.
I purchased the theme and I don't want it to go to waste.
Has anyone achieved something similar or could they point me in the right direction to get this theme to work with shopp plugin?
Thanks!
I would assume that the synergies between two different plugins like those two are very few. If you really like the way your theme looks though, you can always grab its markup code a reconstruct the theme with Shopp template tags & functions.
Approaching this is a lot like making a new theme entirely. You would need to know HTML, CSS and PHP; If you do, the job can largely be reduced to copy & paste by downloading a theme for Shopp and then work through template file by template file, replacing the existing markup code with the one from you theme. But be aware that if Shopp has functionality that was not included in WP E-commerce, your theme will likely not have provided styles for it.

Categories