Is there a simple way to echo content of plugin's admin page to frontend? I would like to diplay to my subscribers opitons from another free plugin, that creates a page in admin panel. For example I have admin-page URL:
admin.php?page=????
and want to display content of it using php on normal wordpress site.
Thank you for your help!
Try calling the function you made in the plugin file. If you made a separate file get the plugin directory and use include().
Related
I would like to roll out static content via a word press plugin. Lets say the folder rolled out is located at domainname.com/wp-content/plugins/pluginname and I would like to access it via domainname.com/pluginname for example.
I have the following quesitons:
How would you roll out this folder if you like to have it some kind of installable.
How do we solve the access via the desired url?
Thank you for helping!
I am not sure what you are trying to achieve exactly, but here is a possible solution.
Create a custom page template in your (child) theme folder by making a file and include that will hook your custom template page to WP. (See this page for more information) On this page your can basically pull any WordPress functionality that your require.
<?php /* Template Name: Example Name */ ?>
Switch on Post Name option in your Permalinks settings for pretty permalinks and then create a new page in WP that will use your newly created template. On that URL you can access the code that you've supplied in the custom page template.
I need to use the main navigation menu from a wordpress page on a non-wordpress page so that the menu can update on the non-wordpress page dynamically.
I want to be able to update the menu on the wordpress backend, and have it automatically update on the non-wordpress page.
What would be a good approach for accomplishing this?
Thanks!
It's possible to include WordPress on a page without using a WordPress theme. Add this to the top of your file (and make sure the path to wp-load.php is correct):
<?php
define('WP_USE_THEMES', false);
require('wordpress/wp-load.php');
?>
I've done this before when I want to tap into useful WordPress stuff (like a contact form plugin) on a page that isn't on the WordPress part of my website.
I am new on wordpress and are using the themes as well. May I know where do I put a new file if let say main.php? I want to make a custom main page and replace the index.php page on the theme. Do I need to put it under htdocs\wordpress\wp-content\themes\<theme-name>. I am using this locally on my computer.
On my main.php, I also include css file. Where do I insert the css file as well?
you can set your front page in wordpress dashboard customization options
Go to Administration > Settings > Reading panel.
and select the page listing in dropdown , but before that you have to create a new page and select you custom page from dropdown . see the below image.
refer this for more info
you can have your css file keep on style directory of your theme and link it in your main page using
get_template_directory_uri() . '/styles/your-style-file.css'
You have to create page template for this.
Have a look over below thread hope this will help you
https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/
The problem!
I have a Wordpress site up and running. I wanted to add a custom page, for example if I browse to site.com/mytest it would display just Hello world without any css etc.
What I've tried
I added a mytest.php file under var/www/wp-content/ and tried to browse to it. (The code simply echo a static text).
What I got was simply a 404 page by Wordpress.
To view the file you uploaded, browse: site.com/wp-content/mytest.php
If you just type site.com/mytest , wordpress will thin you are reffering to a page stored in the wp-database. Since it's not you cant view it.
To add the page in the menu, use custom menu and add as "Custom link".
You can make your page a wp custom page template by adding this at the top:
/*
Template Name:Your Page Name
*/
Then create a page in the wordpress dashboard pages and select your page template from the page template dropdown.
I need to add few additional pages to my wordpress site.
These pages should not be "part of the site", ie they should not be linked somewhere from the posts and so on.
However, they should have the same header/footer as the rest of the site ( I am using custom theme ). And they should be accessible via url.
The final requirement is, I should be able to code in php.
At the moment, I tried to create a new "Page" in my admin console. And then write some php-code inside. However, all my php code gets commented and since not executed.
I don't think that installing plugins such as Exec-PHP is a good idea, so I am trying to find other solutions.
Any comments/advice/suggestions how to make it?
I would be grateful if you give me some how-to link.
Thank you in advance.
You can use a custom page template in your theme for this and just keep the site empty in the admin panel:
http://codex.wordpress.org/Theme_Development#Custom_Page_Templates
By using Template tag's you can create custom page.
write this code on the top of your php file....
/*
Template Name: Your Template Name
*/