I’ve a question about Wordpress’ post and pages. I’m not new to Wordpress but this feature is a first for me and I can’t really seem to get my head around it.
The case is, that I have a parent page (focusareas) which has a number of static childrens (child01, child02, child03, etc.) These children are as mentioned static and do not change (or change very little over time) but the thing is that there will be some blog posts which are related to them – but the blog posts also have to function as an independent entity. Each blog post can have a number of comments, but the child01, 02, 03, … n subpages cannot have comments.
Is it possible to “connect” or “relate” a blog post to a page (subpage) and list them on the subpage?
I don’t know if I’ve explained it correctly but otherwise please let me know and I’ll draw a diagram or explain in further details.
Sincere
- Mestika
I think you need 2 things.
The first is use custom fields to store wich posts ( or category, or anything else ) is related to this page. http://codex.wordpress.org/Custom_Fields
The second is use get_posts loop, to "call" these posts inside other loop, with all his features: http://codex.wordpress.org/Template_Tags/get_posts
Related
Is it possible to set/connect first custom post's taxonomy (values) to other custom post?
Just random and basic example to understand a little better:
First custom post: jazz concerts
Second custom post: places to crash/sleep for night
Both custom posts has it's own taxonomies and post_metas, for
example: location, price etc.
Now we need a connection between posts & taxonomies so that you find most nearest locations to crash if you are going to jazz concert - that can probably be done by WP_query & I got this.
I've never seen anything like that in stackoverflow or in WP docs. I tried but it was too long, complicated, didn't make any sense and generated infinite errors & I thought I ask before trying again, maybe someone has been dealing with this kind of situation.
Do I just need to name taxonomies and post_meta differently and get them to query same way as post's own taxonomy and post_meta? And all same from here?
How to get other post's taxonomy/post_meta dropdown box or other types of inputs to admin edit page?
I hope that I expressed myself clearly. If there's any confusion or questions, let me know & I'll provide additional information or explain something in more depth.
You can register a taxonomy against several post types: link in the second parameter of register_taxonomy() you can provide an array of post types. Those post types will then have the same taxonomy.
I want to redesign my website using WordPress (as CMS) and Bootstrap (as front-end).
Now, I've been pretty successful at doing so, but I have one specific problem.
I have a tutorial website and I want the navigation structure to look like this :
If the user is on my 'website-name/tutorials' then display to him all of the tutorial series titles in an unordered list (so for example C++, XHTML and CSS - but not individual tutorials in each series)...
If the user clicks on some specific serie, then display an ordered list of the elements (so, if he clicks C++, then URL will be 'website-name/tutorials/cplusplus' and he will be able to see all of the tutorial in an ordered list).
If the clicks on one specific tutorial, then the URL goes (for example) 'website-name/tutorials/cplusplus/installing-the-program' and user gets all the content related to the tutorial.
Now, I have been experimenting with this and concluded that the best solution is to create custom post type named "Tutorial" and then make every single tutorial that post type.
However, since on 'website-name/tutorials/cplusplus' I want to display the list of tutorials in "C++" tutorial series and on 'website-name/tutorials' I want to display only the tutorial names, I don't know how to do that.
I tried to do that using Hiearchical posts (so, for example, I made a parent post named "C++" and it's children were all of the tutorials in the C++ serie).
However, I have a problem with that, because my C++ tutorial series has 100 tutorials, but it shows me 101 list elements (I made the website display all the custom post types in an ordered list), with the first one on the list being C++ (the parent post).
So, I'd like to echo the series name only on the 'website-name/tutorials' not on the beginning of the list.
I researched and people seem to use archive in custom post types, rather than parent/child system for this kind of navigation.
I just wanted some of the WP experienced users here to tell me, which is the better solution for my problem? Dealing with these parent/child problems or switching from parent/child posts to archive posts?
If I understand fully perhaps using standard posts and categories will do the trick? Your '/tutorials/' page can display the full list of all posts and when a user clicks on a specific category (e.g. C++) only the relevant posts will display.
You can use the following code to list posts of a specific category:
<?php query_posts( 'cat=20' ); ?>
Changing "20" with the chosen category ID.
Hope this helps!
My idea is to have a page where two authors can post multiple posts (in the page) and other visitors can comment the whole page:
I had in mind a very simple (hack) approach which is:
Having a custom "page" that has all the posts of a category and that page can be commented
Having a page where two people edit the content (but then the multiple posts are faked by being one page only being modified) and normal comments for the page
Use of taxonomies (which I am not very used to) and create a custom taxonomy where you can post and comment, any hint on this one?
Is there any better way of achieving this?
There's a great plugin for this: https://wordpress.org/plugins/pagely-multiedit/
If you don't want to use the plugin, you can carve out the functional code.
Let me know if you have any other questions/issues regarding this or if it doesn't fully solve your goal.
I'm building a blog where three people will be writing, but they will have a separate section on the site. The structure is built upon categories and looks like this:
User one
Clothes
Fashion
Life
User two
Family
Life
User three
Family
Friends
Life
I've set all three users as writers and used the plugin Restrict Categories in order to lock their categories to the sub-categories the matching each top level category.
Now here comes the question, if I visit http://site.example/category/user-one/ I want to have a listing of all the posts, including the sub-categories since there will be no actual content in the top level category that you are browsing.
I've tried making this using filters bound to pre_get_posts but I still can't get it to work. Does anyone else here have any ideas?
I've also given some though into actually creating a multisite network for the purpose, but I then realized it will be hard to fetch posts from all the networks at once.
Thanks in advance, Jonathan
#Jonathan: Not sure if I am misinterpreting what you are hoping to achieve, but given that each author will already have their own 'author' page which lists all their posts (if your theme includes this or something you could create or customise), there may not really be a need for Users 1-3 to be their own category?
Going back to your question, for listing subcategories, perhaps https://wordpress.stackexchange.com/questions/13485/list-all-subcategories-from-category might be of some help.
As for listing posts, to keep things simple, I reckon you might be able to use e.g. get_posts (http://codex.wordpress.org/Template_Tags/get_posts) and build custom arguments, perhaps in a loop if you prefer to use one instead of slug/id specific category templates.
http://codex.wordpress.org/Category_Templates
If it's any help, Bainternet actually created a plugin that makes life a little easier to define category templates: http://wordpress.org/plugins/custom-category-template/
I've search everywhere but haven't found what I'mlooking for even though I'm convinced there must be a solution floating around since it's obviously such a common request:
I want to display a list of authors with a short excerpt of their latest post.
I have a list of Authors with their images (using the 'Author Avatars List') but what I'm missing is the display of an excerpt of their latest posts next/under their image.
Any thoughts?
Thanks in advance!
JD
Edit 26 Sept
I realize from the First two answers my question was a bit to fuzzy - the emphasis should have been on the 'authors avatars list' wp plugin (http://wordpress.org/extend/plugins/author-avatars/).
In the meantime I have created the following solution:
http://wordpress.org/support/topic/plugin-author-avatars-list-get-display-excerpt-of-authors-last-post?replies=2#post-1710752
Thanks for you input!
JD
From get_posts() , you can get all the posts , since each post has a post_author property, you can get all the posts written by each author with a foreach loop, from this you get the latest post per author , and from the latest post , get the post_excerpt content.
Assuming you're using Wordpress...
I'd do a hybrid direct SQL and loop approach.
Query for user_ids from the user table who also have a post_author present in the posts table. Loop over those IDs to get their user object and then their latest post. The only thing you lose here is fine grained control over the ordering of users.
Here is the solution:
http://wordpress.org/support/topic/plugin-author-avatars-list-get-display-excerpt-of-authors-last-post?replies=2#post-1710752