I found a article on the atk4 blog http://agiletoolkit.org/blog/integrating-agile-toolkit-with-wordpress/ I followed the instructions and i get a error and it says the ApiWeb Class not found. Then I looked in index.php on the real framework that you download and it initializes everything differently then the blog post did so. I'm wondering if ATK4 can be integrated or maybe I'm doing something wrong?
I'm also currently integrating a wordpress site with ATK4 at the moment.
The ApiWeb.php class is present in the atk4/lib directory in both 4.2 and 4.1.3 versions of atk4 so not sure why you are getting an error.
What is suggested on the blog page about integrating ATK4 with wordpress is that you would load the ATK4 libraries as php embedded in the pages so you would need to ensure you change the include line based on where you have placed the atk4 files.
<?php
include 'atk4/loader.php';
$api=new ApiWeb('sample_project');
$api->add('jUI');
.. .. ..
$api->execute();
?>
I havent tried this but think you would need to verify the path to ATK4 is correct.
I've taken a different approach to integrating Wordpress and ATK4 - rather than embedding ATK4 into the pages as per the blog article you referenced, i'm going with installing wordpress in one installation and ATK4 in a separate one and using the same template in both.
The wordpress template i'm using is from themeforest and it came with a WP folder containing the Wordpress files plus a HTML folder that contains example pages. I took one of the HTML pages and created a new templates/default/shared.html inserting the atk4 tags such as in the appropriate places.
I've created a menu in Wordpress Theme->xxx->Menu which are mostly static pages from Wordpress and one menu option which is a link to the start of the ATK4 root. Because i'm using the same template, it looks like a single site. In my case, i'm not using the login functionality of Wordpress - all the wordpress pages will be accessible without logging in but i am using a dynamic second level menu and options based on the logged in user which will be defined in Frontend.php
The ATK4 menu gave me a problem because it wasnt consistent with the site and after a while trying to style the menus with CSS and create a submenu using Menu_Basic and Menu_Lite, i went with using ATK4 Views and split the HTML from the wordpress theme, to create a menu.html, a submenu.html and a menuitem.html and have set this using code in Frontend.php
It's still a work in progress so i can't provide the link at the moment as it's not online yet but it seems to be working and may give you other ideas depending on what you want to achieve with integrating ATK4 and Wordpress.
If you want to have a common login for ATK4 and Wordpress (using ATK4 to control the access each user has), there is a plugin for Wordpress that might help with external DB Auth so you could use this with the BasicAuth of ATK4 instead of using Wordpress Auth functionality.
Related
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*
I have found multiple postings with similar phrases but all too specific to their issue and not addressing this...
Most of the website requires a login session. I have built a custom plugin for WordPress to handle my CMS needs, etc. I have included a blog in the website. However, my issue is... How do I require login when "blog" is selected on the menu. AND I do NOT want to show WordPress anything. I want the blog to look like the rest of the site.
Basically I want to "nest" the blog in my website with one required login session. I have the menu item "blog" set as a category so as to pull the WordPress pre-built functionality. So this is the only item I am not able to php a login session as there really isn't a page to do so.
I have read several things. But finding them a bit confusing. Many say to change the wp-config.php but I am not comfortable with changing core files within WordPress. What am I missing or misunderstanding?
UPDATE:
Would changing the menu selection to a "page" instead of "category" and insert php file within that page with a redirect using header('Location:mysite.com/blog_files (of course after session verified) to redirect where WordPress has stored my blog? Is this a viable work-a-round?
You can use your wordpress as API point. Wordpress comes with REST API. So what you can do is get all posts after certain action. Then parse them in html.
There are 2 things to keep on mind.
1st is that everything on wordpress is post.
2nd is that to change certain parts of how api works you add filters to functions.php.
Hope I was helpful.
UPDATE
I have successfully "nested" my blog into my website so that login session is required. Changing the menu selection to a "page" instead of "category" and insert php file within that page with a redirect using header('Location:mysite.com/blog_files (of course after session verified) to redirect where WordPress has stored my blog files. This was quick and easy. However, it still requires WP login to participate in the blog. :(
I'm writing an AngularJS/Express/NodeJS/MongoDB website. Within this website, on the navigation bar, there's a section called "Blog", another section called "Advice articles". I intended to use Wordpress to publish the blog and publishing articles on my site, due to its outstanding ability as a blogging and CMS platform. My question is how to properly integrate Wordpress into AngularJS/Express/MongoDB system? I have come across articles on how to include AngularJS as a Wordpress subpages, but I haven't seen any articles on how to include Wordpress as an AngularJS subpage. Does anyone here know any tips/pointers/articles on such a strategy ?
My current strategy is :
Let AngularJS routing service handle the route to "Blog" section.
"Blog" section is template, which includes an iframe, that points to the Wordpress site, sth like this :
<div>
<iframe frameborder="0" height="800" width="1200" scrolling="no" ng-src="http://localhost/wordpress/?page_id=4"></iframe></div>
I can display the blog by this strategy. But it still a little bit off, I have to do some manual CSS. Is there a better way to do this out there ?
Also since I want to allow the user to comment on page without asking them to log in again. How do I integrate the login done in Express/MongoDB with Wordpress user login, which is a PHP/MySql system. Are there any article out there that shows how to implement this ?
Thanks in advance,
P.S : I do not want to go the route of rewriting my site as a Wordpress plugin, I and my friends want to maintain AngularJS/Express/Node/MongoDb as our primary MVC stack.
My advise is make wordpress API with wordpress plugin, and build commincation angularJS and wordpress through JSON api , read this article
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/
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.