I am trying to implement WordPress into quite a large site with a complex page structure and struggling to get normal pages to work (not created through the admin)
When I link to them, nothing happens, well because...
The desired url -
www.website.com/dir1/dir2/dir3/page.php
The actual url-
www.website.com/wp-content/themes/themename/dir1/dir2/dir3/page.php
The problem with linking to the latter is that it breaks the WordPress functions
I don't want to have to give every page a template, then add it through the admin, it is too much work. I only need 2 pages to contain dynamic content.
I need the files to be inside the theme folder or the wordpress functions will not work.
I also need to keep the folder structure (obviously), but creating new pages using template folders will lose this structure.
Am I being silly? I am really confused.
In WordPress, there are two basic kinds of content: static content and dynamic content. Dynamic content refers to posts in your feed; static refers to the pages. Both are handled in the admin section. Because WordPress is a publishing platform, its main concern is the content. Because of this, static and dynamic do not refer to your ability to update them from the admin section, but rather the frequency with which they will be updated. I have many websites that have static pages that have not been updated since the day I created them. Blog feeds, however, will change frequently. The former are static, while the latter are dynamic.
If you want the first url structure, the way to go about it would be to do one of two things:
create the pages through the back end
using hierarchical structures to
achieve the url structure (i.e. dir1,
dir2, and dir3 would be pages, not
directories. They would also be
hierarchical, meaning page.php is a
child of dir3, which is a child of
dir2, etc.), or
create those
directories physically in your web
root folder. As long as they don't
conflict with your WordPress folder
structure (wp-content, wp-admin, and
wp-includes), they will be served
instead of a WordPress page.
If you're going to be creating a new php page for each and every static page on your site anyway, I would really suggest just using WordPress for this. I can't imagine you would be using a brand new (and unique) template for every page, so it would save time to use WordPress as it's meant to be used: as a publishing platform.
Related
I have a site that was made in WordPress and I need to remake it just with HTML and php.
The problem is
I have a page at the url www.mydomain.com/create
I created a new file with same name, www.mydomain.com/create.php
Now on the host I removed the extension .php, but the problem is i will still hit the word press page.
Where can I find the file with the url set for this page? I don't know much about word press besides where plugins are.
WordPress does not use one file per page / post. WordPress instead has a template system inside themes that defines how pages and lists of posts are turned into HTML. The content of those pages and posts resides within the database and can be viewed in wp-admin. Further, WordPress extensions and themes can define hook functions and filters to modify content and style of the page and execute code upon certain events.
You cannot find a file for this "/create/" page. It has some content in the database but the content itself won't render into what you see in the browser.
Sorry to say this, but if you like to recreate the site, you will have to find a new way of constructing and rendering it (and also reusing code). You might also want to look for a proper framework like Laravel and have some proper routing in place (instead of renaming PHP files).
Edit:
You can change the permalink for create like so:
UPDATE PREFIX_posts SET post_name = 'create_old' WHERE post_name = 'create';
You have to adapt the MySQL table name to the WP posts table by replacing PREFIX with whatever prefix your WP posts table has.
I'm a WordPress developer who's been tasked to create a temporary one-pager to a Drupal site. The client would like to have a simple front page with a logo and 4 external links until their new site is ready. Normally I'd just make a simple index.html page with some CSS and call it a day. But in this case they need some of the sub-pages from the Drupal site to continue to work.
Had it been a WordPress site, I would have just created a new template file and a new page inside WordPress, and made that the front page. But as I have zero experience with Drupal, I don't know if you can do the same thing here.
What is the easiest (quickest) way to make a simple splash-page as the front page, while having the rest of the drupal site continue to work? The splash-page should ignore all CSS and JS from the original theme — preferably have a completely independant section fromt the rest of the site.
In Drupal 7 you have few "levels" of templates. First you have "most outer" template html.tpl.php It contains html head and it is usually common for all pages.
Then inside that html.tpl.php you'll include page.tpl.php. That one should again contain some common page elements, as header and footer, but again, if your design requires that, you can have more than one page template.
Page template will include node template. In drupal you have 2 basic content (node) types but you can create many more of them. Basically for every different page layout you can create new content type (but there also are lot of different ways to achieve the same thing).
Basically you should create new content type called i.e. "splash" (machine name!). Add fields to it if they need to be back-end editable.
Then you should create new template file for your content type. Name matters, so you should call it node--splash.tpl.php . You can find and copy to your theme existing node.tpl.php and change it to your needs.
Keep in mind that when ever you add/remove new template file you have to clear the cache so drupal would scan theme directory, notice and start using new templates.
And if you need also different page template for you page you'll have to put some code into you tamplate.php file:
https://www.digett.com/insights/overriding-page-templates-content-type-drupal-7
Drupal template engine design an specific file name for override front page.
You can create the file html--front.tpl.php, and this will be used only for the front page without touch any other page. You can page here your custom HTML and reference css/js.
If the page you need share common styles with the rest of the site, I would recommend to instead override page--front.tpl.php which is basically the content of the page without the tags
For more information here is a link https://www.drupal.org/docs/7/theming/howto/customize-the-front-page-template
I inherited a implementation of Gallery2 embedded in a Drupal site. I need to change the url of the page this is on from /gallery to /somethingelse.
Drupal is not something I am very familiar with, but I've done some stuff here and there with it years ago.
The /gallery page is not listed anywhere in the admin interface and the content is living in page-gallery.tpl.php.
A 301 redirect is going to be necessary (which I do know how to do), but that isn't the solution I'm looking for obviously (just to avoid getting that answer). Is there any simple way to change this url?
First you will have to understand how drupal handle URLs & generate a page based on it. There are several way to have a URL in drupal, where you can navigate from somewhere.
Usually we make page(add content) of some content type, which you create before with all the required fields. Drupal give serial node number to all newly created page, so to have your own custom URL, you will need to use PATHAUTO module, which will create URL based on title of the page, though you can modify at time of creating page.
We create listings of some things e.g. images for gallery by help of VIEWS & we can create page for the listing. We get to give URL for the page, which you can edit any time.
We declare URLs in our custom module under hook_menu(). Other contributed module also do the same & that's why you get some pages when you enable the module.
Apart from page content, drupal have block system. A block can contains content, image, links etc & display of it can be set to all pages as well as any specific page. So there is no limitation for you to make your page with the URL which you want if you are using PATHAUTO module. If you have listing from views or code which is generating page, then you can always go there & change.
I have a site and I'd like a sub section of that site to be blog.
Details:
The site is fairly dynamic.
I have image carousels that get populated via custom-post-types utilizing featured images.
I have titles and headers being populated via custom-post-types and etc... That's all in the index file.
I want to create a pure blog (i.e. news style subsection of the site that aggregates latest blog posts on the www.domain.com/blog, has widget areas that post related content, comment sections, etc etc...) as a subfolder of the landing page.
I was thinking that I would create a new instance of wordpress and put it in a subdirectory of the domain called blog. Obviously this is not an optimal solution.
I'd appreciate any help.
No reason to do another install of wordpress. Just create a separate template and go from there.
These two links should get you started:
http://codex.wordpress.org/Stepping_Into_Templates
http://codex.wordpress.org/Template_Tags/get_posts
I have a wordpress site that i've been working on that has some pages (as in NOT posts) that a client changes content on in order to target particular keywords. these pages have been using podscms for content management.
The client now wants to be able to duplicate these pages any number of times and edit the text within them. So basically, he wants to be have a dozen or so versions of about 4 linked pages.
Does anyone know if it's possible to duplicate an entire multipage structure like this in WP?
Or any WP driven sites that implement segmentation similarly?
I think your best bet would be to use Page Templates. You define them in the theme and then for each Wordpress page you create, you can select which page template you would like to use for the page. This sounds like what you're trying to accomplish.