How to disable WordPress blog folder

To clarify, /blog and /blog/ are the same. The slash is added by the browser to properly structure the URL (best way I can explain it). Your’re trying to access two different pages with the /blog/ slug. In this case, WordPress is overriding the blog link from your existing website and showing content from there. … Read more

How do I add a checkmark to my-sites save settings hook

It sounds as though have altered the page to submit your data. Assuming that that code work properly: my-sites.php loads admin.php 10 require_once( dirname( __FILE__ ) . ‘/admin.php’ ); Which fires the load-{pagenow} hook 330 /** 331 * Fires before a particular screen is loaded. 332 * 333 * The load-* hook fires in a … Read more

Different post styles depending on category

If your theme has body_class() in the body tag (normally in header.php) then the category name is added to the body tag as a class e.g. <body class=”my-category”> So in a css file you can do .my-category #my-element { background:#FF0000; } To edit the html for the categories to make them card layouts then you … Read more

How to display the posts and news in front page?

Try to implement this program into your html page: <ul> <?php global $post; $args = array( ‘posts_per_page’ => 2); $myposts = get_posts( $args ); foreach ( $myposts as $post ) : setup_postdata( $post ); ?> <li> <a href=”https://wordpress.stackexchange.com/questions/267899/<?php the_permalink(); ?>”><?php the_title(); ?></a> <?php the_content(); ?> </li> <?php endforeach; wp_reset_postdata();?> </ul>

Images in Blog List

Hey I got the code to get the first image from the content, from this answer, Get first image in a post from Diana but modified the code a bit. So if this is helpful please mark that answer aswell. Insert the code inside your functions.php or create a new plugin. function catch_that_image() { global … Read more