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.
Related
I have experience with Wordpress but is my first time with Divi. Based on the client design, I need simple change. On the image below you could see block from the blog(a post list used on the homepage in my case)
What I need to do is showing the date, category and title in a different order. Which is the best way to change this. I'm using a child theme and I tried to put the file includes/builder/module/blog.php and edit it but I don't have any luck.
Thanks
Do you have the divi page builder ? If so, it might be possible in the settings of the section where your post is located (you can edit it directly from the front end editor).
I am fairly new to WP and very new to Roots (http://roots.io/) and I am having trouble creating a custom home page. Here's how far (I think) I understand it:
To create a custom home page I put a file named "front-page.php" in the WP root directory. This file is based off of "page.php".
"front-page.php" loads "content-page.php" from the templates directory.
And that's where it gets a bit fuzzy to me. The function "the_content()" lives in "content-page.php" and I'm assuming it loads the content of the page but it's loading some default stuff (I think it's added by the Roots theme) that I don't want there. I don't think the proper way to customize the home page content is to modify "content-page.php" and remove or change the function "the_content()". I'm assuming there is a better, modular way to do this, possibly creating a custom class that will be loaded when "the_content()" is called but I don't know where and how to do that.
As you're a bit vague with the details I'm going to have to read between the lines a bit. If you need further clarification just ask:
the_content() just outputs the content stored for a particular post, which you would edit in the WP admin. In terms of editing the markup that surrounds the content you have a couple of options. You could edit content-page.php as you require, or create a new partial (such as content-home.php and load that instead.
You can also use filters for modifying content; these are often used to change content that appears in multiple places such as 'read more' links. Check out this introduction to filters for more info.
In closing, you don't want/need to edit the_content()
I'm trying to figure out how a certain WordPress sets things up. I'd like to have a special page where I could make WP calls and interact with the theme, without affecting anything else.
I just making test.php and putting it into my theme's folder, but that doesn't work.
#Eliran provides one possible option, but you could also add a page in the back-end of WP, just make sure it has the slug 'test', and change your 'test.php' filename to 'page-test.php'. If you're worried about the public seeing this, set the page visibility in the admin to 'private'.
Edit:
to move your understanding along a little further also, you should review the way that WordPress determines what file to grab to render a particular URL. This can be pretty confusing to start with, so be patient if you're not familiar with it, but it's at the heart of designing WP themes. I'll link to the examples, and if you scroll down a little there's a diagram that, along with the text, will help you see how WP is 'thinking'.
http://codex.wordpress.org/Template_Hierarchy#Examples
You can see here: Page Templates
all you need to do is create a page named page-{custom-name}.php and add it to the theme folder.
and inside this php file add:
/*
Template Name: My Custom Page
*/
and than to use this page you need to go to the wp-admin, add/edit a page and chose it:
inside the php file everything you do is classic wordpress.
all this is giving you is a custom page tamplate.
Put it in your root folder. When you go to look at it, you'd look at www.mywebsite.com/test.php
It may be other ways to do this, but I rather use the rewrite API and custom query vars, to create custom routes.
A previous answer on the subject can be found here
The basic idea is to add a new url rule, catch the query var with the parse_request filter and maybe do a die or redirect to prevent the default wordpress template from loading.
I prefer this over theme templates, because with templates you need to create a page for each new url, and if that page gets acidentally deleted, that functionality would stop working.
What Pages are Not:
Pages are not Posts, nor are they excerpted from larger works of fiction. They do not cycle through your blog's main page. WordPress Plugins are available to change the defaults if necessary.
Pages cannot be associated with Categories and cannot be assigned Tags. The organizational structure for Pages comes only from their hierarchical interrelationships, and not from Tags or Categories.
Pages are not files. They are stored in your database just like Posts are.
Although you can put Template Tags and PHP code into a Page Template file, you cannot put these into the Page or Post content without a WordPress Plugin like Exec-PHP which Read overwrites the code filtering process.
Pages are not included in your site's feed.
Pages and Posts may attract attention in different ways from humans or search engines.
Pages (or a specific post) can be set as a static front page if desired with a separate Page set for the latest blog posts, typically named "blog."
More About Pages.
In WordPress to add a new page you have to log in to the admin/backend and from the pages menu you can add a new page. In this case, you can select templaes for your page and also you can create a custom page template for that page.
You may read Createing a new page in WordPress. and custom Page template in WordPress.
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.
I have created a wordpress.org blog on my website but I do not use the actual blog page to display the blog posts. Initially I tried to style the wordpress blog to match my site, but since wordpress' theme is too constricted I decided to use "the loop" to gather the_author_posts_link, the_title, the_content, etc and display them on my main page. (reference: http://www.corvidworks.com/articles/wordpress-content-on-other-pages). The problem I am running into is the comment section. No matter what, I cannot seem to find a way to add comments to my front page using php. I know I can get my post content to display by calling the_content(), but I cannot seem to find a similar function for comments. I'm open to any solution that will allow my pseudo-blog to display comments under each post.
Thank you!
Should be <?php comments_template(); ?>. Look in your theme files for that template tag. But it working depends on if you've correctly included the blog header on your non-WP pages.