Show content only on front page?
<?php if(is_home() && !is_paged()) { ?> http://codex.wordpress.org/Conditional_Tags
<?php if(is_home() && !is_paged()) { ?> http://codex.wordpress.org/Conditional_Tags
Strange. Outside the loop, the_title() should give you the current page name, if you really are on a page, and not viewing a specific post. If it gives post title instead, it may mean that you are somehow inside a loop. But if that were true, wp_title shouldn’t show “Blog”. See if other options give … Read more
I was able to fix this problem only in phpMyAdmin. Shortly: find the child page in the table ‘wp_posts’ and change the value of ‘post_parent’ to 0 (zero). Step by step: Browse the table ‘wp_posts’, find the child page by title (post_title) or whatever else attribute. Be sure it isn’t a revision (check it in … Read more
I’ll just copy/paste my answer to that question, here: There are many ways to accomplish this, though some are more advanced than others: Mark the blog post as sticky, and then set Posts per Page to 1 (Dashboard -> Settings -> Reading) Create a custom front-page.php template, and query the post in question, either via … Read more
If you are doing this directly in functions.php you are doing it wrong. It is too early for conditional tags to work. This should be hooked to wp_enqueue_scripts, see wp_enqueue_script() docs.
This is why I asked for more code context. I’ll have to guess that you are checking for the front page outside of any hooked function, or inside a function that is called too early, before is_front_page() is ready. The following will work. function your_function() { $d = is_front_page(); var_dump($d); } add_action( ‘wp’, ‘your_function’ );
To remove pagination prefix page in home page you should: add a rewrite rule which will translate the new link format, prevent redirection to address containing page, replace URLs in paging links. By creating pagination links, WordPress appends query var paged with mentioned prefix to url. Therefore, without modification, the links would look like example.com/3/page/3. … Read more
If the posts are already shown on your page, just with a bunch of unnecessary text that you want to take away, do the following: 1. Open the template file of your homepage (it can be named different in different themes, so impossible to give you the exact name of file, but usually they are … Read more
If your video is pasted into the post body, you have a couple of options. Use a filter on the_content and preg_replace to remove the content. Wrap your content in a shortcode. I am going to recommend option #2 because option #1 involves processing markup with regex which is tricky and prone to error, and … Read more
Use it like this : <div id=”page” class=”hfeed site”> <?php do_action( ‘before’ ); ?> <?php $page_id = ( ‘page’ == get_option( ‘show_on_front’ ) ? get_option( ‘page_for_posts’ ) : get_the_ID ); $banner = get_post_meta( $page_id, ‘banner’, true ); if (is_front_page() || $banner == ”) { ?> <header id=”masthead” class=”site-header” role=”banner”> <?php } else { ?> <header … Read more