All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
0answers
32 views

Set a template on a custom post in the plugin

I looked at some answers and didn't help I'm trying the next section (right away) but it returns the template if errors in WordPress's built-in function lines. Like get_header () add_filter('...
0
votes
1answer
51 views

the_content() printing DOCTYPE, <html> and <body> tags in the middle of page

I'm building a custom Wordpress theme and I've just come across a bizarre issue where the_content() seems to be printing out the page content wrapped in the following: <!DOCTYPE html PUBLIC "-//...
0
votes
1answer
25 views

Page template not working when logged out

I created a page template that removes the navigation and footer coder (while still keeping the call to the style sheet and any javascript) and it works when I am logged into wordpress, but when I log ...
0
votes
0answers
9 views

edit_form_after_editor hook not work

I'm following a tutorial to create a custom page builder based on bootstrap 4. I have a problem with the page template registration, I've installed the classic editor and I've tryed to make it a ...
0
votes
1answer
20 views

How to Change Site Elements based on referring URL

I want to create WordPress website that changes branding and theme based on the referring URL. We provide white label services to funeral homes and we want to create a generic site where funeral ...
0
votes
0answers
27 views

How to add a full working piece of website already coded, to a large scale Website design project?

I've written 5 PHP files each of which are dependant of each other and contains one style.css also. This whole project works fine when executed alone and includes home.php which includes HTML code for ...
2
votes
3answers
208 views

Loading page template into shortcode

I am attempting to load a page template into a shortcode so I can easily load the content wherever I want. I have done some research and many people have said this code has worked for them but for ...
0
votes
1answer
183 views

get_page_template_slug returns incorrect path

I'm currently experiencing a very strange issue which I can't find any reason to it. I have a theme which is working fine on all servers. Now, I have one client who is having issues with it. The ...
0
votes
1answer
131 views

Inject class in body when particular page template is used

<body <?php body_class(); ?> > In header.php I have written the above code. But I want when this page template is in use: page-customer.php then body_customer class should go above. ...
0
votes
1answer
22 views

Use wordpress for /blog section only and all other pages static, but using same footer.php and header.php

I'm trying to achieve something that I think should be fairly easy, but somehow I'm stuck. I have created the css and html for a number of static pages and a blog section and now I want to turn it ...
0
votes
1answer
102 views

Custom Template 404 for specific custom post type

Some solution to create a custom template for (page 404) for specific custom post type.
0
votes
1answer
344 views

remove_action() not working in page template - Genesis

I've had a good look around but can't find anyone with the same specific problem. In functions.php I'm adding the following actions: add_action( 'genesis_entry_header', 'twl_content_wrap_start', 15 )...
0
votes
1answer
60 views

Dropdown menu for categories

When I use this code below <?php wp_nav_menu( array('menu' => 'categories' )); ?> I can make a new menu to list up for example alle categories in wordpress I created. I use it to list up ...
-2
votes
1answer
110 views

Loop on a wordpress Page instead of content coming from the WP text editor

I have created a page template: <?php /* Template Name: homedefault */ ?> But Instead of text coming from here i.e. wp editor: I want it to come from the loop: <?php if ( have_posts() )...
2
votes
1answer
21 views

Switching between custom templates in a post type of the admin menu

I created a post type in the admin menu through function codex_custom_init() { $labels = array( 'name' => _x( 'Book', 'post type general name', 'your-plugin-textdomain' ), '...
1
vote
1answer
173 views

How to display pictures from database?

I am adding all the webpage content to the database. Later on I check the page id and select the corresponding post. There also picture for example: <img class="componentIcon" src="<?php ...
0
votes
1answer
52 views

can't grab PHP $_POST variable

We're using a custom thank you page that is designed to display a custom brochure PDF depending on what landing page sent you to the thank you page. On the landing page, we're using a Gravity Form ...
1
vote
2answers
4k views

Change title only in dynamic page

I've been trying to change the title in a dynamic page without any luck. What I did is I created two page-templates from where I load items (occasions) from an external database. In one page-template ...
0
votes
1answer
678 views

Exclude pages with certain template from wp_list_pages

Before you mark this as duplicate I have tried every method in all the other questions and non of them have worked. I am trying to exclude any page with the page template page-noindex.php from the ...
0
votes
1answer
129 views

Pass form attributes to another php template in wordpress

I know that this question gets asked a lot of times but I tried everything and still have problems figuring out why it's not working... So I have a the following form (still not final): <form id="...
1
vote
1answer
116 views

Dynamic content in template

okay, so here is a quick example of code in a template, page.php, file: <?php print_r(getdate ()); ?> Website is setup with WPEngine. When logged in (into wordpress) works 100% and date/time ...
0
votes
2answers
853 views

Display custom field on 404 page outside loop

I'm using ACF to display a class within a <header> tag. The code for this sits within header.php. The custom field appears across all page templates in WP admin. Here's how it's working on the ...
1
vote
1answer
67 views

Populate editor with some content of a page with a page template

I have a page template like "page-salespage.php". what i'm trying to do is show default content in tinymice editor when this page template applies to a page. here's how i tried to achieve this, but i ...
0
votes
0answers
31 views

Code works on page-example.php by not category-example.php

For my category page for food I originally had it on category-food.php however the code wasn't working properly. I had trouble figuring out why until I pasted the code onto another php file, page-food....
0
votes
3answers
67 views

Posts are not looping through correctly

I am trying to make the page have 3 posts in each row, and then after 3 columns (12 posts) show the ajax load more button. Right now only one post is showing up. I don't know how to make it correctly ...
1
vote
1answer
2k views

How to get the value of input hidden html from text editor to custom page template?

I have 10 or more input hidden in 10 or more pages with different values in Wordpress text editor and I want to get the value using $_POST in a custom page template. How to do this? I tried to called ...
2
votes
2answers
2k views

is_page_template not working as expected

I'm trying to serve different headers based on what type of page the user is on. This is my code. <!-- IF HOME --> <?php if ( is_front_page() && is_home() ) : ?> &...
3
votes
2answers
498 views

load/require specific php files for specific pages/templates/post types

I have a plugin with multiple php files. I want to load some of them only when specific template files are loaded. I don't want to load everything. Currently, I'm doing it with add_action( 'wp', '...
0
votes
2answers
934 views

Calling PHP function doesn't work in index.php

I have a function I wrote in my functions.php page for a gallery to display on certain pages. It displays on custom templates, but now I need it to display on index.php Here is the code from my ...
0
votes
1answer
20 views

Create page in templates for pages or the pages manager?

In terms of slowness and loading which differences noted in the pages created as a template and created by adminisrtador? Example template page: <?php /** Template Name: My Page name */ ........
0
votes
0answers
74 views

Create a custom theme-specific page, invisible in the admin-panel?

I've learned that when I want a custom page, I need to create a page template, create my page and assign the template to it. Also I've read about fake/virtual pages, where the page is generated on the ...
0
votes
2answers
167 views

Adding wrapper elements in the_date() like in the_title()?

So this works: the_title( '<h1 class="entry-title">', '</h1>' ); But this does not: the_date( '<h4 class="entry-date">', '</h4>' ); I don't know enough if this is reserved ...
4
votes
1answer
2k views

Check if a menu is empty?

I have menus set corresponding to a custom field on a page. Ie I have menu1, menu2, and menu3 on three pages under custom field => MenuName. Under functions.php I have: /* Add Menu Locations */ ...
0
votes
2answers
947 views

Showing content from one page on another

There are many posts that seem to strike around this area, but I'm more and more confused by each one I read. I have a page that shows the "Terms of Service" (id = 1086). I would like to display the ...
1
vote
1answer
866 views

how could I load a different template part by page

I would like to use get_template_part(); to load a different template parts on different pages. so on the home page it loads get_template_part( 'content', 'home' ); and on the blog page it would load ...
0
votes
1answer
261 views

Execute php in pages

I need to execute my personal php code in wordpress to print data from a mysql database. I've to execute it only on pages. My idea is to create a file page-pagename.php, copy the body of the page.php ...
0
votes
1answer
49 views

Use page.php for front page

For some reason even when I am selecting a static page for my homepage it is still choosing to load the index.php file. I would really appreciate your help on this as I would like it to load my own ...
0
votes
1answer
84 views

Why isn't my link attribute getting my css?

<link rel="stylesheet" type="text/css" href="style.css" /> That is the line I am using. The style.css file is in the same directory as the file I am running that from. Tt specifically just won’...
0
votes
1answer
271 views

Make a page (url) not cacheable [closed]

How to setup a wordpress-page in wordpress as non-cacheable in wordpress? I have made up a form manually for a page(wordpress) and I want to make that page not cacheable by browsers. How can it be ...
0
votes
1answer
141 views

Change page template programmatically inside foreach

i have been trying to attach multiple pages, eash to its page-template using a foreach loop... Manually meaning writing each page code works but inside the foreach loop it wont work. I have several ...
0
votes
2answers
3k views

Display custom meta box in my template file

Need help displaying my custom meta boxes on a template file. Following a tutorial Here's the code from my functions.php: function get_custom_field( $value ) { global $post; $custom_field = ...
0
votes
1answer
492 views

Display all pages - in order

My goal a single-page vertically-scrolling site. I'm using this code to display all the pages one after the other: <!-- All Pages --> <?php $pages = ...
1
vote
1answer
87 views

Page Automatically Generated from Theme?

I'm running WordPress multisite and would like each site to have a specific page (with pre-loaded content) generated from a page template, contact.php. Rather than go through each site and create this ...
0
votes
1answer
68 views

Display pages from specific page template

Okay I have found the following code on line, which seems to be working and displaying all of the pages using the page_library_html.php template. This code only shows the title of them though. Can ...
0
votes
1answer
169 views

How can I put a custom field as the link of a button shortcode?

I have been working on a custom page template, and cannot seem to figure out how to have a custom field for URL's as the link for a button in the loop. Here is my code <?php echo do_shortcode("[...
0
votes
3answers
167 views

Display additional page templates and a sidebar on plugin activation

I'm developing a child-theme off of the Twenty Twelve (1.1), using Wordpress (3.5.1) and the Woocommerce plugin (1.6.6). I've noticed that the problem with creating the online shop, single product ...
20
votes
2answers
24k views

Getting only direct child pages in WordPress with get_pages

I am trying to fetch all direct children of a page. But I am getting all children and grand children as well. Any ideas? PHP Source: $args = array( 'child_of' => $post->ID, '...
0
votes
1answer
50 views

Tables not showing divs and loop/php items

I know this is an absurd questions, as who uses tables anymore? I got handed this and just need to make it work really. I don't know anything about tables so it's been a learning experience. I ...
1
vote
1answer
721 views

Changing the template hierarchy

Is there an easy way to change the WP default template hierarchy? For instance; Say I want to change my theme directory structure so that it completely changes from the Template Hierarchy suggested ...
1
vote
0answers
144 views

Automatic Shortcode Creation with Custom Fields [closed]

This is basically a php issue as I'm fairly new to it and can't figure out how to code things the way I want. I am basically trying to pull information from custom fields (grid reference) and post ...