Static Landing Page Templates in Wordpress - php

If I create custom static HTML landing page templates using the Bootstrap framework, what is the best way to integrate those into an existing website within Wordpress?
My goal is to be able to quickly integrate custom PPC landing pages into WP sites without having to deal with the poorly coded websites I often face.
Here's are some thoughts I had and the problems I'm experiencing:
I could place a folder in the website's root directory that holds the files for the custom template (separate from Wordpress). The issue I'm facing is how to handle all of the form submissions / fills and how to push them to a Google spreadsheet or CRM.
I could create a custom page template within the existing theme and just dump the static HTML template in there. But how could I do this in a way that it has it's own CSS / Images and doesn't effect any other page on the website?
Is one method better than the other? What would you recommend?
I appreciate it!

There really isn't an easy way. If you are looking to integrate the Wordpress navigation system, footer, and page creation system then you will have to create your templates using the Wordpress Theme Templating standard.
Start here: https://developer.wordpress.org/themes/basics/template-hierarchy/
Because of the way Wordpress enqueues its style and javascript files, among many other reasons, not following the template system will cause updating issues as well as restrict the ability for certain added plugins to function in the future.
You will have to write your static bootstrap templates as Wordpress templates.

Related

Wordpress Dev: Understanding Scope of plugins or general WP Architecture

I am trying to understand a bit about how WordPress works in development..
I already created some shortcodes that I can just edit in on my page and some WIdgets that seem to display on every site or blog post that I created...
My question is: What is the general scope of the widgets or plugins in WordPress that I create? I know there are hooks and WordPress API functions to only show them on specific parts of WordPress, e.g on the admin-panel, or just in the widget sidebar of a page...
But are there some good sources about the architecture and scopes of how and where to use your plugins? Are they kind of injected into every page I create on my WP pages? (e.g with enqueue_scripts or so?). It's just a bit too overwhelming for me as a beginner to get a good overview...
And how are those functions from WP API made accessible in my plugin files/folders when I never imported them? I guess it's based on some module technique but no idea how..
It's good to delve your feet into the WordPress (WP) new concept called blocks you can find all the details here: Block Documentation
Creating widgets and shortcodes is a way older process nowadays most people keep their eyes on WordPress Blocks and especially FSE (Full Site Editor) therefore I would suggest you start learning that thing ASAP.
Let's come to your queries:
How WordPress works technically
Go to your WordPress directory you will find the file called index.php which is responsible for bootstrapping your application
Along with the index.php you will find a few directories called
wp-admin
wp-includes
wp-content
wp-admin
Where WP have all functionalities happening in the admin part are executed by accessing classes and functions present inside of this directory
wp-includes
This directory has all the utility and helper classes and functions
wp-content
This is the only directory developer can add/edit the files which store all of your plugins, themes, uploads, and other custom directories if your
code or any other plugin code created
For more details on how WP works
It's quite a challenge to explain all the ins and outs WP in a single post but you can find the detailed explanation in the official documentation
WordPress mainly depends on hooks and hooks are come under any of these two categories:
action hook
filter hook
For more details on WP hooks
How do plugins or themes work?
Both plugins and themes have a terminology called headers using that header metadata WP fills all the details in the plugins listing admin page and in themes listing page
For more details on header
Themes mainly depend on the concept called loops which responsible for fetching the posts data and build the necessary details using template tags and iterate them using the loop. Based on the type of page the user visited WP uses the template hierarchy to render the page as per the request that happened on the client end.
For more details on how WP loops works
For more details on how template hierarchy works
Headless CMS
Yes, you can make your complete WP into a headless CMS with the help of WP REST API. The REST API is used to access WordPress outside of the WP for e.g. if your android app need to fetch any posts or categories or user from WP using this REST API it can do that. Also you can create your custom endpoints too
Additionally, try to explore WP CLI
I believe that I covered most of the things required to understand how WP works, to be clear this post abstracted many of the things to make it as compact as possible for anyone who started entering into the WP development.
If you like to know more of these abstract explanation in a detailed way then always visit the official documentation
If your ide have an auto-complete feature please try to explore all of these functions (wildcard list) which contains most of the security functions provided by WP
is_*
exists_*
validate_*
sanitize_*
esc_*
*kses*
*nonce*

Questions regarding wordpress

I am a developer who has never used wordPress before and just had a couple of questions about creating a custom theme
To create a specific look to a website do I create a static design then inter grate it with wordpress and add the dynamic content where it needs to be added?
If you create a custom theme how do you make it dynamic rather then being static? When I switch themes I loose the all the appearance menu options such as (menu, widget, header and background) How do i create them?
For stuff like image carousels if I want the images to be dynamic do I create a widget for it in the functions.php file?
For all the text on the page do I just spit that out thru the visual editor? seems to break links when editing
What are starter themes?
Sorry I am quite new to Wordpress but have knowledge in html, css, js and php but I just struggle to understand how to integrate a custom design and make it all dynamic
As a first step to create a basic new template I would recommend you starting with one of the default WP themes (e.g. Twenty Fifteen), leave all the core files (they contain dynamic parts e.g. functions loading header/footer/content) and just customize the css files and images. Further customization would require changing code in php files (e.g. header.php for the header, index.php for the homepage, single.php for the article page, etc.)
It is true that some options related to header, background, etc. can be theme dependant, so when you change it the configuration gets lost, but the others like menus and widgets remain like they are when switching themes.
Yes, for stuff like carousels you usually have to use custom widgets and plugins, you can find some really good ones on the web (e.g. this one), so you just upload the images and apply configuration in the backend.
Yes you use the WordPress editor (as you see it has Visual and HTML view) for all the user content within the pages and posts. Broken links might be cause of using relative paths, just make sure they are complete.
As mentioned in the first point you can always start with the default WordPress themes like Twenty Thirteen, Twenty Fourteeen, Twenty Fifteen etc.

Wordpress Styling

I am new to using Wordpress as a developer as opposed to just using the dashbord but am struggling to understand a few things and would really appreciate some help.
For a site that does not require a blog - do you just create custom/specific page templates for each page that your site requires?
If so - presumably you code the content directly. But then how does the client edit their website's about page or any other page for example - because doing it through the dashboard isn't going to use the necessary CSS hooks without using classes, id's and HTML?
As a beginner to Wordpress - I can't see that posts are used on sites that don't have a blog, but am I correct or is using posts the way a client can edit content on their site, but just have posts styled to look like normal content?
Or am I wrong in thinking a company (I am starting as an intern at a web dev company that use WordPress) provides the tools or at least configures WordPress to enable the client to change content?
Any help getting me to understand the basic concept and way a developer would create a custom WordPress site would be much appreciated. Thanks in advance.
You can use page.php. In WordPress everyone create at least one custom template type to get wider design for custom pages.
You can refer here for more info.
Use Advanced Custom Fields with page templates. Say you are making an About page, call that template about and select that template in the backend editor. Once you save the page, the acf fields will show up and you can populate the content.
ACF: https://www.advancedcustomfields.com/
Page Templates: https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/

How to handle user customizable website themes?

We are developing a CMS and would like advice on the best way to handle user customizable themes. We have a couple ideas but are not really sure what the best approach is. The CMS will allow the user to customize every part of the site including colors, fonts, layout, etc, through a theme editor UI built into the CMS.
We were thinking writing a custom CSS parser that writes changes out to a CSS file for that theme. This approach seems like it may have a lot of point of failure and a lot of overheard.
The other way was to store all the CSS in a database and then just use inline CSS.
The CMS has been built using JQuery and PHP with MySQL database for user information and content, but not CSS.
Is there a more efficient way to parse/control/edit CSS properties of the theme?
Thanks
My suggestion is to take a look at the way WordPress or any other pre-built platform (Drupal, Joomla, etc.) approaches this. WordPress themes consist of template files stored on the file system that allow users to have complete control over the look and feel of their Web site. The CSS for each theme is stored in a file called style.css. WP itself does not enforce a frontend layout but instead leaves that in the hands of the site administrator/developer.
I would treat your CSS files as if they were code classes. For instance, have a CSS file for your customizable font themes, one for page themes etc.
With that in mind, on page load you can easily build a dynamic CSS file based on user selections.
AKA
font1.css
font2.css
font3.css
page1.css
page2.css
page3.css
On Page load you identify that user preferences are font 1 and page 2, pull in both css files and walla you're good to go!
I am currently looking to do the same thing. Some of the solutions I've come across seem to use an xml file for the layout and then (probably) parse out a custom css file. This way, the layout determines the "stacking order" of page content modules and the other customizable features (which are usually limited) such as fonts, colors & background image are handled by an additional custom (user)css file.
I'll be following this one and will also be interested in finding actual code solutions to making it happen. For instance how to use jquery to build a draggable content module interface for the user backend.

Modifying WordPress's "post-new.php" File for Custom Blog Entries

Has anyone ever modified the "post-new.php" file in their WordPress installation?
I want to modify the look of this page to include pieces that I standardly include in my blog posts, and I just don't know if it is do-able/easy/worth my time.
Should I just find another CMS that allows more modifcation like Drupal?
No reason to modify the core files - you can add stuff via plugins. See, for example, the more fields plugin - it adds to the new/edit post form without breaking your ability to upgrade the core installation.
Drupal's great, but if you're focusing on blogging you may get better results tweaking WP via plugins. I use WordPress for blog sites, and Drupal for most others.

Categories