I hope someone might be able to help me with this. I have a page layout that top half is page template and the text area at the bottom is a widgetised area.
Previously to replicate a look of a page we have copied and altered the page template, added a new widget area and called that into the new page.
However, I have tried to do this and I am not sure what I have done but I cant get it to call the correct widget area.
The original page is http://www.haylockpittman.co.uk/painting-and-decorating/ which is newpaint.php the template was copied, altered and uploaded to create http://www.haylockpittman.co.uk/builders-painters-decorators-and-refurbishment-contractors-surrey/ which is surreypaint.php
We created a new sidebar called "Surrey Paint" and widget area has been filled in with different text. However, despite everything looking like it is fine and calling up the correct sidebar it is still calling up the widget area from the original page.
Any help to perhaps point out where I am going wrong would be much appreciated.
Thanks
Make sure your new page is referencing the correct sidebar.
http://codex.wordpress.org/Function_Reference/get_sidebar
It is possible that the theme you started with might have that function buried within a few includes...so some refactoring might be needed.
Related
I'm trying to get on developing websites on Wordpress for easier management for the future admins.
I have created a bootstrap theme on my own. I got all the pages smoothly into Wordpress and are now easy to edit. However I have this one page which has tables, buttons, glyphicons and once I click the "graphic" view while editing the page it breaks it.
So I was thinking that that won't do and I decided to create a new plugin to fix this problem. A simple plugin which has few textboxes on the admin settings page and then just prints the texts on the page where I want them to go.
However I tried to look for tutorials and I'm just overwhelmed. I have gotten my plugin to work somewhat. It has a admin setup page and it can print customized text to a page where my shortcode is. Thanks to this post!
However, I still don't know what to do from this point on.
My question is: Could you help me by giving me an example code to get the same kind of textbox to my plugin's admin page as I have while editing/adding new pages (with graphic view) which saves the text and displays it on a page.
I have no idea if this is the way to go but I can't think of anything else right now. I was thinking that the settings page has a couple of textboxes and the text in them goes where I want it to go on a page. So the future admin won't see the unnecessary html code and therefore can't break it.
I would abandon the "plugin" idea. There are several more elegant ways to do this besides writing a plugin.
By far the easiest to implement is this:
1. Store the html in a "Custom Field" https://codex.wordpress.org/Custom_Fields
2. Display the contents in your page (or post) template https://codex.wordpress.org/Custom_Fields#Displaying_Custom_Fields
So I know this is a bit out of ordinary for me to ask a question like this, but for some reason I am just really having an issue grasping this.
My Problem:
I have a responsive layout theme for word press, its clean its pretty. When implementing Google ad-sense into a text/html widget on the right bar it over runs the widget size and over hangs on the right hand side.
My Question:
What will be the best method for getting my ad to look more uniform. Is there a way to select a single widget css? Is there a way to put a div inside that widget and select the parent css from that div? Should I go in and hard code it into the theme?
Additional:
The theme I am using has a built in child theme option which I have chosen to use. When I place the code into the child themes function.php it breaks the theme and displays what I enter as plain text to the screen. Adding opening and close php tags did not seem to fix this issue.
Well it appears once again I asked a question before fully digging my brain into this. Hopefully this will become something useful for someone else.
FIX:
It appears that wordpress assigns a unique ID to every widget that is created.
Created New Text Widget
Wordpress Assigns: text-1
I can now go into css and manipulate this widget directly.
#text-1 {
//do somthing
}
It's always best to avoid hardcoding WP themes as when they get updated your modifications might vanish.
Glad to see you figured it out, I was going to say that you CAN add a div inside a widget and give it a name, which might still be be better than use the WP assigned layer name, as that might change if you were to delete or re-add the widget.
I have bee getting to grips with Wordpress and so far so good. The one thing I cant workout is how to edit the default template which is being used for my home page and any subsequent new pages I create.
My aim is to remove the "Comments" and "Latest News" that appear by default and instead setup my own image slider, text etc.
I just cant find the code that is setting what appears in the template.
So far, as well as lots of digging in the files, I have created a new child template and CSS to go with it but now I need some help.
Thanks all.
I have probably missed something but I have been trying to work out what and I am having no luck.
I have added a new page template to my wordpress site, created a new widget area (necessary as this is how the original designer built the site).
However, the page appears to be calling content from another widget area.
The page in question is http://www.haylockpittman.co.uk/builders-painters-decorators-and-refurbishment-contractors-surrey/ and it appears to be calling widget area "New Paint" despite the code calling for "paint surrey" which contains the correct text for the widget area.
For note the widget area is basically the bottom half of the page.
I hope someone might be able to help me get my head round this.
Thanks
As you have created a separate sidebar, now you must be seeing that in your admin panel.
So just add the widgets you want to appear in the sidebar.
Next go to your sidebar.php page, there you cana put a condition i.e. for the products page
If your products page is a separate template then use the name of the file i.e.
if ( is_page_template('your-template.php') ) {
register_sidebr('name of the sidebar');
} else {
register_sidebr('name of the sidebar');
}
I am new to Word Press and I have been assigned to change something at work in our homepage.
I am always worked with raw HTML/CSS/php files, so I am a bit out of place here.
The page in question is the following: GAN Integrity Solutions Products
Inspecting the html I found where the CSS is (in the theme folder).
If I go in word press under pages, and I choose Products (which is the page I want) there is not content in it even in the text or visual editor. (but the page does indeed have content)
I installed the plugin called "Always edit in HTML" but it only removes the Visual tab and does not really replace it with the HTML tab (like I have seen a friend of mine has).
Also I am currently using WP v. 3.7.1 and I have not update because I still had to learn what happens when one updates (does it screw up my site? I can't afford to screw it up).
Anyone have any idea of what I am doing wrong or how I can solve this?
Btw the different "products" are created individually under "Portfolio" but what I would like to edit is that first link page html. What I need to do is instead of having pictures in the "squares" and then text as ones mouse over them, the reverse.
I would appreciate it!
Can you try to login in Wordpress?
You should go to pages and search for the product page.
Then check the template part.
Go to your themes map again and search for that template.
Your code should be there.
This is my first comment. Hope it is helpfull.