Get Content From Blog Page

You are using get_the_content() wrong, it can’t take a ID, which is what get_option(‘page_for_posts’) does return, and generally gets the content of the current post inside the loop, in which it has to be used. To get the actual content of that page you can do: $page_for_posts_id = get_option( ‘page_for_posts’ ); $page_for_posts_obj = get_post( $page_for_posts_id … Read more

How to embed page content in a blog post

Create a shortcode to embed the content. This will always be synchronized. Sample code from an older project. Just updated. 🙂 GitHub: https://gist.github.com/3380118 · This post in German (auf Deutsch) on my blog. <?php # -*- coding: utf-8 -*- /** * Plugin Name: T5 Embed Post Shortcode * Description: Embed any page, post or custom … Read more

What is archive.php used for?

index.php and archive.php might be the same but don’t have to be the same. index.php will display your blog post archive and in the absence of archive.php (or other more specific archive files) it will display your date, author, etc. archives as well. But it doesn’t have to. You can, if you want, display your … Read more

Check if current page is the Blog Page

If by ‘blog page‘ you meant a static page set as posts page in the Reading Settings, then you could check it by doing this: if ( is_front_page() && is_home() ) { // Default homepage } elseif ( is_front_page() ) { // static homepage } elseif ( is_home() ) { // blog page } else … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)