Move Index to a page

When changing the setting to make the front page a static page, you will have assigned the blog posts to another page. If you name that page ‘blog’ you can access your latest posts at yourwebsite.com/blog No extra tinkering required 🙂

Load featured article once in a loop

I was able to find a solution to my own problem. For anyone needing to solve this in the future, WordPress offers a set of conditional statements for just able everything, include pagination. <?php get_header(); ?> <?php if ( ! $paged || $paged < 2 ){ ?> <?php locate_template( ‘featured-post.php’, true, false ); ?> <?php … Read more

Any way to insert text on page from a query results?

Ok, but I was afraid it’s not really a good solution. Works, though. First, I rewrote the query in order to get pretty permalinks: /*Añadido: Reescribir URL query: “?pa_dispositivo=nombre&pa_marca=nombre”*/ function custom_rewrite( $wp_rewrite ) { $feed_rules = array( ‘tipo/(.+)/marca/(.+)’ => ‘index.php?pa_dispositivo=’. $wp_rewrite->preg_index(1).’&pa_marca=”. $wp_rewrite->preg_index(2) //”(.+)’ => ‘index.php?pa_marca=”. $wp_rewrite->preg_index(1) //”(.+)’ => ‘index.php?pa_dispositivo=’. $wp_rewrite->preg_index(1) ); $wp_rewrite->rules = $feed_rules + … Read more

Choose template depending on URL

One post cannot (and should not) have two single post URLs. All you can change is the archive view, the list of posts. If /gallery/ and /extra/ are post of the post type page, use a custom page template for those. Update Create two endpoints gallery and extra for the root (EP_ROOT) (another example). The … Read more

How do I get the comments section to show up?

if you look in the twentyTwelve theme. you can see how they get the comments. Look in the full-width.php file and you can see this code <?php comments_template( ”, true ); ?> this will call the code to get your comments section. Now you must make sure that your theme has the comments.php. You can … Read more

1 post, 2 templates

Your best bet would probably be the Rewrite Endpoints API. The API allows you to create post URLs with endpoints like lorem.com/post/133/json/ or lorem.com/post/133/print/. You’ll find useful code examples in the link provided.

get all page templates

Only the page post type can have a template assigned (of the default post types), it’s the custom template you set in the Page Attributes meta box. If you have a page.php template file, your index.php will only be used to display post post types, so those posts will never have a _wp_page_template meta key. … Read more

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