Creating two different posts. Blog and Articles.
-
I just downloaded worldpress and am a complete newbie at it and dont know if what i want is already made a plugin, or if i need to create it myself.
What i want is to be able to make two different kind of posts. The usual blog posts, and another for longer articles that shouldnt be posted in the same area as the blog posts.
Is there a plugin that allows you to do something like that?
-
No, there is a built-in WP feature called categories.
This tutorial will give you a bit of an idea:
https://blog.kjodle.net/2011/08/27/pages-or-posts/If i have understood them right, pages are put on as a new page with their own button and stuff on the, whatever its called, header, something.
This isnt what i want, i want them listed on their own page, like the index of a book. I cant have 500 buttons on the front page for each and every one of them.Been testing a bit now. I have found that adding a custom menu to the showcase page almost gives me what i want. The problems with it is that it shows blogposts and such, the menu doesnt allow indentation(parents and stuff) and the menu follows below the text.
Is it possible to make a custom made page?Try a custom menu:
https://blog.kjodle.net/2011/08/25/how-to-create-and-use-custom-menus-in-wordpress/or using this plugin:
https://blog.kjodle.net/2011/10/30/kalins-post-list-a-brief-tutorial/I have created a custom page template and copied the custom menu php stuff from the showcase-template and have gotten my custom menu to show up on it.
But,
The menu isnt following the text to the right, but is posted at the top of the page(to the right) and the rest of the page follows beneath it followed by comments. I havent found a way to edit the way the menu work to fix it by maybe making it float above or having no padding, etc.
Here is a picture where you can see that the menu pushes the content down. (Blue arrow is my drawing in paint, not actualy on the page)
What theme are you using?
Were you read about post types?
Sabomoth, what you want is:
1) two different kinds of posts: normal blog posts and longer articles
2) and show them as different labels on your menuright?
There are two solutions to this:
First solution: Case were blog posts and article posts are the same, just vary their length and content.
In that case we’re talking about filtering by category.
You’ll have to:
– create a custom page template with a loop that filters by category,
– create a new page for Articles in you Dashboard and assign to it the new template,
– add this new page into your navigation menu,
– and don’t forget to filter out you Articles’ category from the main loop of your blog.Second solution: Case were blog posts and article posts are are actually different, have different fields.
In that case we’re talking about filtering by custom-post-type.
You’ll have to:
– create a custom post type for your articles
(read: https://codex.www.ads-software.com/Post_Types and https://www.ads-software.com/extend/plugins/custom-post-type-ui ). Normal blog posts are all other posts.
– create a custom page template with a loop that filters by custom post type,
– create a new page for Articles in you Dashboard and assign to it the new template,
– add this new page into your navigation menu,
– and don’t forget to filter out you Articles’ custom post type from the main loop of your blog.Good luck!
esmi: I use the normal twentyeleven.
edpittol: I searched google how to make custom templates and made one.BeaCabrera:
I created this post before i had gotten too acustomed to wordpress and didnt know how to turn off/edit some of the automaticly generated stuff. I have now already made a custom template for pages which i will use for my articles. This template uses the showcase-bar widget thingie and i am able to add a custom menu onto that, and it works.The problem though is described in my last post, the content on the page starts below the menuwidgetthing, and not next to it, which i want it to be.
So that is what i am currently looking at to fix, but i am unable to find any settings that has to do with what i want. I cant find a css where i can tell it to float above, give it an z-number or such.(was more then 5 years ago i worked with css last, so might have mixed stuff up) There was a link to a picture at the end showing the problem.
https://img402.imageshack.us/img402/1821/custommenuwordpress.jpg
Thank you very much for the detailed instructions even though i have gone past that part of the problem. ??
Did you make the new page template from scratch?
Could you have messed up where to put your widget code? header? sidebar?
Without a link to the web I can’t see the code, sorry.The page isnt online as of yet as it isnt finished.
But i took the normal page template and pasted in the widget code from the showcase-template, removing the unneccecary stuff that tells it what to do if there arent anything in the sidebar.Anyways, here is the actual code:
<?php /** * The template for displaying all pages. * Template Name: Page with customsidebar * This is the template that displays all pages by default. * Please note that this is the WordPress construct of pages * and that other 'pages' on your WordPress site will use a * different template. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ get_header(); ?> <div id="primary"> <div id="content" role="main"> <div class="widget-area" role="complementary"> <?php ( dynamic_sidebar( 'sidebar-2' ) )?> </div><!-- .widget-area --> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'page' ); ?> <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?> </div><!-- #content --> </div><!-- #primary --> <?php get_footer(); ?>
I can move the widgetpart around, between the content and coments, and it will fall to the left, under the content and above the comments. But still no menu to the left, content directly to the right.
So there must be something in the php or css that i havent been able to find that tells it to do this.
In your code, your widget area is clearly on top of the loop, so it will, in effect, occupy the space right over your posts. I suggest something like enclosing your widget area in a sidebar and placing the sidebar to the left:
<div id="sidebar"> <div class="widget-area" role="complementary"> <?php ( dynamic_sidebar( 'sidebar-2' ) )?> </div><!-- .widget-area --> </div><!-- #sidebar -->
Your sidebar should then have something in the style.css like:
#sidebar { width: 200px; float: left; }
Be aware that #sidebar is already being used in the default theme although not in your own template. Probably there is already an entry for #sidebar in the css file and that suits you. In this case search for it and don’t change it.
Good luck!
Hi
I did just what you said and i am still running into the same problem. The thing is i cant put it outside the contet div, for it then gets put outside the page. If i put it where i had the widget code, the content still posts under it as before.
I have tried adding a z-index to it, and it wont change a thing. It is connected to the css since i am able to change backgroundcolor and such things.
All i can think if is that there is some code in the actual widget or manu that creates this problem?
z-index has nothing to do with your problem.
Your code is clearly as water placing the widget area on top of the loop of posts because there are no columns whatsoever to it.
Try writing a new template based o a template that actually HAS a sidebar, and replace the CONTENTS (not the outside div) of the sidebar with you widget are code.
You need to have a structure such as:
<?php get_header(); ?> <div id="primary"> <div id="sidebar"> <div class="widget-area" role="complementary"> <?php ( dynamic_sidebar( 'sidebar-2' ) )?> </div><!-- .widget-area --> </div><!-- #sidebar --> <div id="content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'page' ); ?> <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?> </div><!-- #content --> </div><!-- #primary --> <?php get_footer(); ?>
or
<?php get_header(); ?> <div id="primary"> <div id="content" role="main"> <div id="sidebar"> <div class="widget-area" role="complementary"> <?php ( dynamic_sidebar( 'sidebar-2' ) )?> </div><!-- .widget-area --> </div><!-- #sidebar --> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'page' ); ?> <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?> </div><!-- #content --> </div><!-- #primary --> <?php get_footer(); ?>
if what you find is a <?php get_sidebar() ?> instruction, replace that with:
<div id="sidebar"> <div class="widget-area" role="complementary"> <?php ( dynamic_sidebar( 'sidebar-2' ) )?> </div><!-- .widget-area --> </div><!-- #sidebar -->
and then rename the file to be your new template.
I have had my code just as those two examples, and what i have done to come to my template is first using the showcase-template, the only template that uses the menu, and removing the unwanted stuff, and at the end just coming down to what i have now, an empty page with the little menu code.
The template using a sidebar, uses the blog sidebar(the one customizable in the widget menu, and isnt a custom menu which i want. That template uses the get_sidebarstuff.
https://imageshack.us/a/img841/6436/firstway.jpg
https://imageshack.us/a/img210/1199/secondway.jpg
https://imageshack.us/a/img812/8629/thirdway.jpg
- The topic ‘Creating two different posts. Blog and Articles.’ is closed to new replies.