Blog page wont use blog-template.php

The page you set as the “page for posts” is really a placeholder, allowing you to access the blog with that “Page’s” permalink, but not displaying it as a WordPress Page and so not pulling in the custom template. The theme’s home.php template will be used for the blog main page, so put your code … Read more

Template Tag Does Not Work in Page Template

The reason your post is not displaying properly is because functions such as the_title(), the_permalink(), and the_content() ( called Template Tags ) can only be used whenever inside “The Loop” or whenever set up properly. There are two options to display your content properly: Functions: get_post(), setup_postdata() and wp_reset_postdata() First you would need to get … Read more

How can I load 2 random pages?

You can redirect users from home page to random page with this code (paste it to your functions.php) function my_homepage_redirect() { if ( is_home() || is_front_page() ){ $page = get_posts( [ ‘post_type’ => ‘post’, ‘posts_per_page’ => 1, ‘category’ => 1, // your category ID ‘orderby’ => ‘rand’, ‘fields’ => ‘ids’ ] ); if ( empty( … Read more

Strip from the_tags() output

Well, you can use the DOM object to change/remove tags and their parameters. See here for all the details https://stackoverflow.com/questions/3820666/grabbing-the-href-attribute-of-an-a-element Code would be something like this: (this sample changes the class of all H1 elements to be ‘a_new_class’, removing any existing classes) $html = “<h1 class=”the_old_class”>A Heading</h1>”; $dom = new DOMDocument; libxml_use_internal_errors(false); // supress errors … Read more

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