Create second, fully customisable loop page in Wordpress - php

I'm looking to do something with a website I'm working on. This is my first time using Wordpress, and I've got most of the things I need to work running fine.
However, I'd like to create another page on my website that can display loop posts that is formatted completely different from the normal index.php file.
For example, index.php has it's own loop, and acts as the website homepage. The second page would be called roster.php, and has a loop that displays and formats posts from a specific category of posts. If this is possible, where would I create the roster.php file, and would it still work properly with my Wordpress installation?
I've dug around the Wordpress Codex, and done several Google searches on this subject, but I can't seem to find anything similar to this scenario. Or maybe I've just misunderstood them all.
I really appreciate your time reading this post, anything you can contribute would be extremely useful to me.
Thanks again, Callum Kerr

You can create a page roster in wordpress and a page-roster.php in your template directory. Wordpress will automatically route the page to the php file.
You can then do a custom search & loop in page-roster.php

page-roster.php should do the trick!
Check this for more info: http://codex.wordpress.org/Pages#What_Template_is_Used_to_Display_a_Particular_Page.3F

You can create custom Templates for your pages, posts and even categories, this Codex Page may help you with examples on how to do it.

Related

Displaying Wordpress Blog Post on Non-Wordpress Page

I've tried searching but can't find any clear answers.
I have a Wordpress site with some non-Wordpress (PHP) pages that are located in the root directory.
I'm trying to display the content from a WP post on one of these non-WP pages. Since the post is constantly updated, simply copy/pasting the content won't work.
I guess I could create a template with the non-WP content and just exclude the theme/header/footer... but I'd prefer to keep the file in the root directory with the other pages.
Does anyone have any ideas of how I can accomplish this?
Thanks in advance :)
Perhaps you could use the rest api? https://developer.wordpress.org/rest-api/
The solution for you is providing an API for your Wordpress posts then use it in non-wordpress pages.
Also you can use the wordpress REST-APIitself, it has provided so many useful capabilities.
Take a look at it:
https://developer.wordpress.org/rest-api/reference/

how to replace excerpt with full posts on WP

First thing first, i'm new with WP and i'm also not very good with PHP.
anyway, i use this plugin http://wordpress.org/plugins/posts-in-page/ to group all the posts that i create inside a specific page and it works good.
Now, i'd like to change the code so that all my posts displayed on the page are not excerpt but the full posts.
I need a full explanation on how to do that cause as i said above i'm new both in wordpress and PHP.
thanks a lot.
There are two ways of doing this. One is to go to the Reading Settings in the Administration interface and select your desired option under For each article in a feed, show….
The other way is to hardcode this in the theme itself. Open the template file (index.php for example) and replace the_content or the_excerpt with the_content.

Simple way to add "the loop" from Wordpress into any html/php template (that is not made for wordpress)

im looking easy steps for convert any html/php template into a very simple wordpress theme for personal use. I have a site, in there i want news at the begining using the wordpress interface, i worked a lot with wordpress and i made some themes, but modifing already made ones, so i didnt care a lot about the code.
So, lookin in internet i dint found a good step by step tutorial in order to create a simple theme in wordpress from 0. Remember that i dont need sidebars, widgets and soo, i only need "the loop", or, the last 3 post made.
It's as simple as installing wordpress correctly and then including the wp-blog-header file into your pages. Doing so will give you access to all of WP's functions.
require('/path/to/wp-blog-header.php');
$posts = get_posts('arguments');

Embedding wordpress into a php page

I'm looking for a tutorial on how to embed Wordpress into a webpage e.g a php page. I found one such tutorial about a year ago. I remember it split the pages into parts making the main require the rest, one of the requires was the blog posts on the wordpress. I'm looking for this tutorial or something similar. Basically I just want all of my blog updates appearing on a php file.
Thanks.
See http://codex.wordpress.org/Integrating_WordPress_with_Your_Website
Just grab the rss feed from your blog and parse it. That should be simple enough.
I found a way to display my latest blog posts on my website's home page using SimplePie. My blog is built on WordPress but my home page is coded by hand, so it took me some time to figure out a way to do it. I wrote a blog post about it if you care to check it out. Displaying WordPress posts on a separate web page. Hope it helps, let me know if you have any questions!

Get Wordpress sidebar from another Wordpress blog?

I want to write a plugin that will pull a sidebar from one Wordpress blog and place it in the sidebar of another blog. I know to write a plugin, but actually don't know where to start with this idea.
I believe he's saying that he wants to write a plugin to be able to retrieve a sidebar from another website and display it (possibly as a widget?). If that is not the question then I apologize; otherwise, I'll take a shot at answering.
The first thing I would recommend would be to view the code of just about any other widget plugin to make sure that a plugin (and not just some JavaScript) is really what you want.
Assuming you want the plugin, check out this resource for some basics. Also, you'll need the retrieval code which will either be "screen-scraping" in PHP or AJAX partial page loading with JavaScript.
I hope any or all of this helps you get where you're going.

Categories