All Questions

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

Show Yoast SEO meta tags in Custom WordPress Templates (Theme)

I overwrote twenty nineteen theme in WordPress and included all my templates. After that, I installed the Yoast SEO plugin to add dynamic meta tags to pages created using custom templates. I have ...
1
vote
2answers
94 views

Disable front-page.php template

I use front-page.php on my template to display home page. But I want to disable if the user uses another page for the home page from settings. Is there a solution? When user select a page from ...
0
votes
1answer
26 views

How to properly add and access a JavaScript file in Wordpress?

I intend to use a JavaScript library on my WP website and have uploaded the JS file via FTP to the following directory belonging to the currently activated theme Salient: /public_html/wp-content/...
0
votes
1answer
15 views

How to show metabox on page if it is using a template

I was creating metaboxes for a special kind of pages. But i got stuck when showing metaboxes to the pages only who currently have the template 'Sky'. my template file name is sky-template.php and ...
0
votes
1answer
182 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
28 views

Template for front page (latest posts)

I am having index.php -> This renders the latest post with sidebar page.php-> This renders the page layout : Templates are fullwidth,sidebarleft& sidebarright single.php-> This renders the ...
8
votes
1answer
506 views

How to move page template files like page-{slug}.php to a sub-directory?

I want to move page template files like page-{slug}.php to a sub-directory within my theme, in a way that WordPress will recognize them automatically. If the page templates of the said form doesn't ...
1
vote
3answers
25 views

How to create a custom page(not a template) in a theme

I have been searching for theme developing info but all that are related to this subject are talking about a custom page at page.php. What I am trying to achieve is different. The scenario is that I ...
1
vote
1answer
30 views

Highest number of WordPress Custom Page Templates?

I'm little bit rookie in understanding WordPress core. But I would like to know that, is there any limit or should we limit to how many custom "page" templates we make in our custom theme? My ...
0
votes
2answers
49 views

Modify available templates (in dropdown)

I'm developing a WordPress theme with several templates. One template is called "Tabs". If a page with this template assigned has children pages, parts of their contents are shown in tabs on the ...
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
2answers
35 views

Can I show all the template files that are being used on my site?

I have a legacy theme that has a lot of page template files. My site is too big to go through each page one by one to check it's template. Is there any way (either through adding a column to the ...
0
votes
2answers
69 views

Load sidebar template just once to prevent multiple animations

I have a home template with a header, footer and a left sidebar. <?php get_header(); ?> <div class="content"> <?php get_sidebar('left'); ?> <div class="middlebar"> ...
0
votes
1answer
27 views

Group several custom global page templates in sub-folder

I have to create several global page templates, and, in order to keep them organized, would like to have them in a subfolder. So far I don't know how to do it, the template-parts/page/... structure is ...
0
votes
1answer
31 views

What is the best way to build home pages with a lot of sections for distributable themes [closed]

I want to develop high quality themes by taking in to account all the important things like usability, accessibility. I just want my theme to be "perfect". Here is my dilemma. So, what is best way ...
0
votes
1answer
67 views

What is the point of using the front-page.php template? [closed]

You can use front-page.php to create a static front page, it will override all other templates and static front page settings, but the problem is that you can't edit the front page then. You can't ...
0
votes
1answer
198 views

Problem with Displaying Custom Theme Page's Content

I've created a custom theme, and I want to display a custom theme page that I created, whose file name is page-about.php. The only way that I know that it's possible to display custom theme pages in ...
-1
votes
1answer
460 views

Page attribute template dropdown not displayed even the syntax is correct

<?php /* Template Name: foo */ ?> I added this to my foo.php but dropdown not displayed in admin panel.
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 ...
1
vote
1answer
39 views

Single Page theme [closed]

I would like to build a wordpress website which is inspired by the home page of the Ace Hotel http://www.acehotel.com/neworleans. I need the content to be easily updatable by the users (non developers)...
1
vote
1answer
52 views

Can Page Templates be Applied to Archive and Post Templates?

If you're familiar with Wordpress, then you already know that Pages have an area to select a template while Posts do not. As well, archive.php and many other pages are handled by a default listing ...
1
vote
1answer
644 views

Template selection area is not visible on page editor sidebar in wordpress twentty sixteen default theme

Template selection area is not visible on page editor sidebar in wordpress twentty sixteen default theme <?php /** * Template Name:Zoho testAPI * * * * */ echo phpinfo(); ?>
0
votes
1answer
119 views

Move default page templates to sub directory

So I know there having custom templates in a sub-directory is a native feature introduced in 3.4. But I'm not talking about custom page templates here. I'm talking about the default page templates ...
0
votes
1answer
411 views

Templates dropdown not appearing using _s theme (underscores)

I am currently using _s via http://underscores.me/ and am trying to add a new page template... I should be able to just add this new page template in the root of my theme, correct? Or should I be ...
0
votes
1answer
103 views

How to show children pages as array

I am creating a template that would display children pages of a parent page. Employees ♦ Managers ♦ IT guys ♦ Designers I want parent page (employees) to display its children pages. ...
0
votes
1answer
33 views

Different stylesheet for different pages not working fully

I am trying to use different stylesheets for different pages, but it doesnt kinda work. For example i made a page called 'Contact' and assigned the template contact-template.php to it. and this is ...
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 ...
1
vote
2answers
574 views

Custom metabox for custom page template

I have created custom page template. Now I have to make it configurable, however since I am using more than one template in my theme I would like to make sure that configuration will be available only ...
0
votes
3answers
1k views

Where to put custom page templates in theme?

I am building a theme (parent theme) and I was advised to put custom page templates in theme root folder. I am copying theme twenty fourteen and found this theme using a separate directory called page-...
5
votes
3answers
6k views

How to move page templates to custom folder?

I created page templates that use the page slug, for example, page-contact.php, page-gallery.php etc. or page id, for example, page-2.php, page-11.php etc. How can I move these templates to a ...
5
votes
1answer
127 views

Is it possible to manipulate the list of page templates?

After answering this question I wondered if it is possible to manipulate the dropdown list of possible page templates that's available when you edit a page. WordPress derives this list from the ...
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
1answer
56 views

Create a variable with string, array or multiple values

I'm running some functions that will allow a user to register their own custom templates to my custom theme from an external directory. They can see these page templates in the wp-admin and they ...
1
vote
1answer
34 views

Implement content-nosidebar.php / content-leftsidebar.php

I've been trying to create Page Layout's so that the person using the theme to position the sidebar either on the left, right or have the page as a full width one. I've looked at another theme and ...
0
votes
1answer
24 views

How to add pages in wordpress using codes?

I am trying to add wordpress pages using codes on theme activation. But the main problem is i cannot check whether the page with that particular slugs exist or not. Our code looks like this : ...
1
vote
1answer
1k views

Custom page template with custom fields

I need to create a page template that has an image and text with a common style. The image url must be set using a custom field (or something like it) and left aligned to the page title and content. ...
4
votes
2answers
741 views

Adding items to page template dropdown on Page Edit Screen

I am developing a WP theme with MVC approach. It only have index.php, functions.php and styles.css on the parent directory. So, I do not want to place page templates on it rather then I want to ...
1
vote
1answer
596 views

get_page_template returning nothing

I run this code in front-page.php as well in category-foo.php <?php echo is_page_template( 'front-page.php' ) ? "yes" : "no" ?> and get both times "no" printed i tried as well <?php ...
1
vote
1answer
243 views

Why is the Page Template dropdown menu using the wrong file name?

This is strange. I have a file, page_market.php, that is named "Market Main Page". It WAS being used when I chose that page template, but now it is not working at all. Instead, it looks like I'm ...
0
votes
0answers
48 views

Why Wordpress gets old templates code instead of the last updated ones

I recently finished building my WP theme (child theme of twentyfifteen). My friend started updating content and accidentally added content to a page which don't have a function that gets and displays ...
0
votes
1answer
147 views

Injecting pre-defined text from custom page template to editor

I am creating a custom page template: < ?php /* * Template Name: sliding content * Description: Sliding category contents */ get_header(); ?> <div id="primary" class="content-area"> ...
1
vote
0answers
31 views

how to setup custom content structures

I have some custom pages I need to develop, and I want them to be easily edited by my client. The problem is that the markup is fairly complicated, I want to be able to give them the ability to edit ...
0
votes
1answer
37 views

Can you create a custom page with content in the center already defined?

Is this possible? So for example, you select from the templates a page called "custom-blog-home" and on this page in the centre you have two section, one is a set of blogs being pulled in and styled ...
-2
votes
1answer
159 views

How to split the site's layout without damaging this layout? [closed]

I have a site: http://roomble.com and I need to migrate it to wordpress (to be particular, I need in the nearest perspective it's plugins and ability to login thgrough the social networks via ...
0
votes
1answer
778 views

Query custom post type and showing its content

I am a newbie in developing wp themes and having troubles showing my cpt. I added new cpt in my functions.php file: // Creates Testimonials Custom Post Type function testimonials_init() { $args =...
0
votes
1answer
57 views

Issue On Displaying Pages with Post Name Permalink

I have a simple Theme like below Right now when I navigate to localhost and site root directory I am able to see content from header.php , footer.php and page.php. then, I simply generated some ...
2
votes
3answers
7k views

Adding Content Areas to Custom Page Template

I am not sure how to ask this, which is why I have been having trouble finding anything via google searches. I am hoping someone here will understand what I am looking for and be able to direct me to ...
1
vote
2answers
381 views

Where can I access my custom page template?

I understand that to create a new page template, all I have to do is create my custom template (in this case, page-custom.php) file, and save it in wp-content/themes/mytheme/. However, where can I ...
0
votes
1answer
143 views

Trouble with conditional tags

I've got some code I want to run on every page other than the blog page and the archive page. If I use <?php if ( !is_home() ) { ?> The code correctly doesn't show on the blog page. If I ...
0
votes
2answers
42 views

Why in the static pages of my theme are showing these information?

I am working on a WordPress theme and I have some problem with the pages\posts layout. For example if you go here: http://lnx.asper-eritrea.com/lassociazione/ This is a static page that show some ...