How to get the latest URL of my blog?

easy to do with get_posts // search the last post $posts = get_posts([ “posts_per_page” => 1, ]); foreach ($posts as $p) { // display the permalink echo esc_html(get_permalink($p)); } documentation of get_posts : https://codex.wordpress.org/Function_Reference/get_posts

How can i restore only Blogs from a SQL backup file?

“Blogs” or posts as they are called in WordPress are stored in the wp_posts table of your database. And custom fields related to your posts are stored in wp_postmeta table. So you should just be able to restore those two tables to get all your “Blogs”. This assumes your database is prefixed with wp_ of … Read more

Customizing a blog page layout

Copied from the WordPress developer documentation on ‘Template Hierachy’, the blog template is displayed using the following template file rules: If your blog is at http://example.com/blog/ and a visitor clicks on a link to a category page such as http://example.com/blog/category/your-cat/, WordPress looks for a template file in the current theme’s directory that matches the category’s … Read more

How to create a page that shows the last 10 posts?

By default WordPress displays your content in a blog format on the homepage. Using Default Static and Blog Page Settings in WordPress. WordPress comes with built-in support for creating a custom home page (static front page), and a separate page for blog posts. To use this method, you need to create two new WordPress pages. … Read more

Using featured image of blog archive page

You need to grab the ID of the page you’ve set as your Posts page in Settings > Reading in order to access its properties. To do that, check for the page_for_posts option, which returns the ID: $page_for_posts = get_option( ‘page_for_posts’ ); if ($page_for_posts && has_post_thumbnail($page_for_posts) { $thumb_id = get_post_thumbnail_id( $page_for_posts); $url = wp_get_attachment_url( $thumb_id … Read more

Blog previews on custom page with more buttons

Now that you have a Page set up as your “posts page,” there are a few things you may want to do. Each theme is built a little differently, so pick the ones that apply in your case. Display the Posts First, create a child theme (which basically just means you create one “style.css” file … Read more

Why the Gutenberg Editor is Not Available In My WP Site?

You have to declare that your custom post type supports the editor, and have show_in_rest set to true when registering the post type. Here is what the official dev hub says about supports: ‘supports’ (array) Core feature(s) the post type supports. Serves as an alias for calling add_post_type_support() directly. Core features include ‘title’, ‘editor’, ‘comments’, … Read more

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