Harryson
Forum Replies Created
-
Forum: Everything else WordPress
In reply to: Permalinks and custom page template questionSo I deleted News as a page, because this seems to be the correct way.
Still cannot make my own templates to work.
Also removed it from the Main menu and added
'show_in_menu' => trueto theregister_post_type(). Does not appear in menu however 🙁Forum: Everything else WordPress
In reply to: Permalinks and custom page template questionIs it wrong to have a page called News at all? Or should I include my news in the menu with
'show_in_menu' => truein theregister_post_type()array?Forum: Everything else WordPress
In reply to: Permalinks and custom page template questionI see, this makes sense, but isn’t working. I was wondering how I can make my own “posts system”, so this is good. However, I cannot make my own templates work.
I have got archive-news.php and single-news.php. But it still keeps using the index.php.
I changed my permalink to
/%post_id%/%postname%/as/news/%post_id%/%postname%/would result as example.com/news/news/ID/TITLE. I guess that part at least was correct.Hmm.. but yeah, the templates are not working. I tried adding Template in the Page attributes in News page edit view, but that doesn’t have any effect on the /news/ itself.
If I could get archive-news.php and single-news.php working, like I want them to work. Then basically all my worries are over and I could use this on so many “custom catalogs”.
Forum: Everything else WordPress
In reply to: Permalinks and custom page template questionOk stuck again.
So I first off created single-news_view.php.
Then registered the post type:
add_action( 'init', 'create_post_type' ); function create_post_type() { register_post_type( 'news_view', array( 'labels' => array( 'name' => __( 'News' ), 'singular_name' => __( 'News' ) ), 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'news') ) ); }I was hoping that, that’s all it takes and it will automatically use that single-news_view.php, but it doesn’t. What am I missing?
Forum: Everything else WordPress
In reply to: Permalinks and custom page template questionI see. I’ve got a direction now, thanks. Still not 100% clear yet, but I will let you know what happens 🙂
Forum: Everything else WordPress
In reply to: Permalinks and custom page template questionYes, Ive got
/news/%post_id%/%postname%/and separate Home and News page. The News page, uses custom page template [theme_dir]/news.php etc. However, the permalink will force the index.php file as the template.. It ignores the News page template, also it doesn’t mark the News in the links<ul>as active..even though itsnews/andnews/ID/TITLE.From my point of view, there should be two options now. Either to have a custom single post template. Or I cannot use permalinks and generate the links myself.. so it would not ignore my
news/and then in the news.php use$_GETinformation to display the post.Made custom page called blog.php that simply displays posts with
get_post();.Forum: Everything else WordPress
In reply to: Permalinks and custom page template questionPossible, not familiar with the wordpress terms yet. Simply put, I wish to have separate Blog page (meaning, static frontpage) called News, that I have cracked. Now I would like to have the “read more” or “detailed view” News -> Article.