Custom page template with Wordpress plugin - wordpress

I want to create a plugin with two Pages. Suppose, when I install this plugin, two custom pages will be available.
Like
www.domain.com/page-1
wwww.domain.com/page-2
How to do this ?? I have searched google many hours. I didn't find any solution.

Though I've not tried it for template file but you can find my gist in the link where I've loaded single.php and taxonomy.php from my plugin.
https://gist.github.com/vishalbasnet23/4cf739624ba3b75e75d8

Related

WordPress blog finding related PHP

I am trying to edit a WordPress site. When I try to edit the x.com/blog/ page nothing happens.
I am trying to find out which PHP files are related to set up the blog page, but I do not know how.
If I can find the right files I can edit those. So how can I edit the /blog page in Wordpress?
Open Admin Dashboard and edit page blog page and check which template is currently using for that page.Then go to "/wp-content/themes/[your-theme-name]/" and find that template.
https://developer.wordpress.org/themes/template-files-section/page-template-files/
Alternative you can check if x.com/blog/ is coming from archive page which is custom post type page. You can find it via go to "/wp-content/themes/[your-theme-name]/archive-blog.php"
https://codex.wordpress.org/Post_Type_Templates
Go to /wp-content/themes/[your-theme-name]/. All files which are responsible for rendering the output can be found there.
Most likely index.php, home.php, front-page.php or page.php are responsible. The exact responsibility depends on the structure of the used theme.
Simple drop a
echo "This file is used currently.";
into the top of those themes and check if this appears in the source code if you are reloading the page.
Also make sure that any caching plugins are temporarily deactivated.
The basics on how WordPress themes are made and which template part is called can be found here: https://codex.wordpress.org/Theme_Development

How to create paginated posts in WordPress?

Can any one tell me how i can split a wordpress post in multiple pages?
This is an example http://www.therichest.com/rich-list/most-popular/top-40-clearest-waters-from-around-the-world/2/
I don't use <!--nextpage --> or <!--more-->
You can use one of the pagination plugins available in WordPress directory to achieve this.
With the Advanced Post Pagination plugin you will be able to create pagination very similar to the one in the link you shared.
Once you install the plugin, you can include the content for every new page inside
[nextpage] [/nextpage]
You can read up more about it here http://codezag.com/how-to-create-pages-within-wordpress-post/

WP disable plugin on specific page(s)

I would like to know how to disable the Easy-Fancybox plugin from opening the images on a specific page. The images on the page below are instead using a filmstrip lightbox from a purchased plugin called 'Photo Gallery'. I require the Easy-Fancybox plugin elsewhere around the website though.
http://181.224.157.231/~alcappar/collections/summer-2014/
Okay I found another plugin called 'Plugin Organizer' which lets you select an action per plugin. It worked perfectly. I hope this is useful to some other people out there.
https://wordpress.org/plugins/plugin-organizer/
Try this plugin https://wordpress.org/plugins/wp-optimize-it/ it will let you disable specific plugins on specific pages

How do I call a plugin in a custom page for wordpress?

So I am trying to do this and I don't know how. I have a wordpress powered website with a plugin called "frontier-post" in it. This plugin makes a new front-end post submission. The way to use it is to put the shortcode "[frontier-post]" in any post in my wordpress page and that page turns into this.
I want to make a custom page for myself, where I can have the content created by this plugin there too. So I do not want it to be a post in my wordpress, but lets say at a corner in the custom page. I have searched and found these but the suggestions there would not work. I am able to include the wordpress so that the custom page has access to posts, etc. but even using this
echo do_shortcode('[frontier-post]');
would not help me. (even if header is included)
These are the similar things i found:
Wordpress/PHP - How to use plugins outside wordpress-powered pages?
Need Help for my Custom Page Template
I would really appreciate it if you could help me with this.
If you are creating a PHP page that isn't going to be rendered inside WordPress, you can't use a Plugin of the WordPress engine to accomplish what you are wanting to build. (As the accepted answer to one of the pages you link to indicates).
Instead, you might be able to use the json-api plugin and have your custom page query it for the data. While it won't render the shortcode, it will give you the raw data to work with.
http://wordpress.org/plugins/json-api/
Edit:
Based on a comment, your do_shortcode should work...just try it without the square brackets.

Find a way around wordpress sitemap plugin limitations

I created a blog using wordpress in January.
Though, I use a custom template for one of my page to display custom dynamic pages. (exemple here)
Now, I use the wordpress plugin XML-Sitemap to automatically generate sitemaps.
Unsurprisingly, this plugin does not crawl the page using a custom template, and the many links within.
However, I thought that the crawlers of the major search engines would do so. But they didn’t. My custom pages are still not indexed anywhere.
So here is my question:
I have found a tool that can comprehensively crawl my website and generate a sitemap. If I use it, do I have to de-activate my wordpress pluging?
Thanks a lot!!
first of all, i'm not experienced in Word Press, but I came out with two ideas about your problem, so, if they could be useful, here are:
1) I don't think the plugin crawls the template. Instead I think the plugin generates the sitemap starting from the sitemap saved in the wordpress configuration (in drupal the sitemap and url aliases are saved in the database for example, and the sitemap plugin starts from there)
2) If your plugin generates a sitemap file (I think it does!), so you have to disable it first of use an other tool
Hope it helps!

Resources