I keep struggling to understand how and why this happens: in some themes I can modify the content of a page (type page) from the dashboard, in others I can't. For instance, if I activate a default theme, say Twenty Fifteen, I can create and edit pages from dashboard. When I creat a theme from scratch, I can add a new page from dashboard, but the content added there is not showing up in the website so editing isn't possible either (my theme has only few files created: 404, footer, header, functions, index.php and style.css). When I visualize a page in the website (local), it displays the index.php content instead of the content from the dashboard. So what is the difference between the wp default themes and the one I created from zero? Please help me understand this. I didn't find any satisfying explanations on Google and posting here is kind of my last resort. Thanks in advance for any help!
to display page content in custom theme you should use
the_content() inside the loop.
You can also create custom template for different pages and assign them in back end.
I think You should use the word press default loop for getting posts.
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); // Your loop code the_content(); endwhile; else : echo wpautop( 'Sorry, no posts were found' ); endif; ?>