Having Problems Getting The Correct Widget Area To Display - php

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');
}

Related

Wordpress - how to add general content area to a specific “page” that's not actually a page?

I purchased a WP theme https://themeforest.net/item/pressville-municipal-wordpress-theme/19949423 and need to add general content area to the People page: https://preview.themeforest.net/item/pressville-municipal-wordpress-theme/full_screen_preview/19949423?_ga=2.67243158.624148492.1570058772-1881232054.1569979687
The People page is actually a section in the WP dashboard (kind of like Media or Portfolio section) so technically not a editable page in the WP backend. I contacted the theme creator and was told that it's customization (not included w/theme) and advised to hard code text into the php. The problem with that is it's not accessible to other users who have no design or code background.. Is there a way to create a page with editable content block for this People section so it's easily editable without knowing code?
Also, the “People” header text changes if you click on subcategories (to “Elected Officials”) for example. When you click a subcategory, the main menu (People page) no longer shows as active which can be confusing to users. Is there a way to fix this so header stays consistent (like Contact page header) and menu item shows active regardless of what subcategory(All, Elected Officials, etc) is selected on the People page? Thanks.
You can create a regular page called "People's page" and add text to it. Then if you want to show that page's content into a PHP template you can do the following:
Step 1. Create the Function
Open up your theme’s functions.php file and paste the following code, likely at the bottom of the page.
function cn_include_content($pid) {
$thepageinquestion = get_post($pid);
$content = $thepageinquestion->post_content;
$content = apply_filters('the_content', $content);
echo $content;
}
Step 2. Use the Function in a Template File
Next, open up the specific template file you want to include the Page’s content on and paste in the function:
<?php cn_include_content(31); ?>
Replace 31 with the ID of the Page you want to include. How to find a page ID.
Is sounds like you need to go to your wp-admin and click appearance/ menus. Here you can remove these menu items that might be default but have no pages associated with them. You can then add the pages you want and come back and create a custom menu. Hope that answers the first part of your question.

How to make Wordpress Custom page

i m a newbie to wordpress. I have started theme development and encountered these problems. I think these kind of problem does have a solution, but i m not able to find it out.
I m trying to make a custom page. Uptill now i have made header, footer and main index page.
I see that whenever my theme is activated, I see these default index page, with header and footer assign to it.
I have also made some cutom about us , contact us pages using the Add Pages Functionality of wordpress.
My Problem:
1.Now I m trying to make custom product page where I will have more than 100 images on that pages, and then i can change the images, add the images and description and the link url in future. I have made some html code and put it in the text Tab . I can also see the images on the frontend of the Custom page. But my template breaks. Images goes up and description goes far below.
Also i wanted to add fancybox to all the images which are goin to be replaced or added. But again my template breaks.
So can we make custom.php page and do some coding or anything which you feel is the right way of doing it, Please let me know.
Firstly create product.php page in templates folder using below code on top
<?php
/*
Template Name: My Product Page
*/
get_header();
// write your code here
get_footer();
Then, assign the above template to the page in admin.
Then, that page you can call in menu.
For more detail, check here :- http://codex.wordpress.org/Page_Templates
Actually you don't really need to create a custom template for this unless if you are planing to use that same template on another page.
If your page name is products , just create a file called page-products.php in your theme root. and write your code inside that page.
If your planing to develop themes first be comfirtable with wp template hierarchy.
http://codex.wordpress.org/Template_Hierarchy

Cloning A Page But Use A Different Widget Area

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.

Issue with wordpress plugin

What may be reason when i am using multiple plugins then some plugin showing in widget sidebar
but some or not like
plugin "wp-auctions" is showing in widget sidebar but
plugin "ultimate-auction" is not showing.
I am using "twentythirteen" theme.
please help me.
Well, take a look at this, http://wordpress.org/plugins/ultimate-auction/installation/
It seemed ultimate-auction is used on a page, not as a widget
Try create a new Page:
Enter this text "[wdm_auction_listing]" as a shortcode inside this new
page and publish it.
Then visit this page to see the auction list.
Goto the Admin page, choose Appearance->Widgets, check Available Widgets on the left side, ultimate-auction might be there, and you need drag it to the Main Widget Area on the right side.

How to get Text Widget Code over Wordpress Page?

Recently i have a requirement from client as he want dynamic sidebar (Text-Widget) content show over the Home Page. So, what ever he enter into text box i.e Link, Image or Text that should be come up over home page.
Can anybody give me hint to show Widget Content over Home or any Page?
Use this plugin Widget Logic
This plugin gives every widget an extra control field called "Widget logic" that lets you control the pages that the widget will appear on. The text field lets you use WP's Conditional Tags, or any general PHP code.

Categories