How to add plugin options in wp editor page
These are post meta. Here are some information to get you started. Custom Meta Boxes Rendering Post Metadata Add Meta Box
These are post meta. Here are some information to get you started. Custom Meta Boxes Rendering Post Metadata Add Meta Box
I think in your case you can do it using css by adding the height: auto; to image tags: .c-entry-content img { max-width: 100%; height: auto; }
Please use this method: // Lets create some test CSS code $css=”/* Some test CSS */ body {background:red;}”; // Stash CSS in uploads directory require_once( ABSPATH . ‘wp-admin/includes/file.php’ ); // We will probably need to load this file global $wp_filesystem; $upload_dir = wp_upload_dir(); // Grab uploads folder array $dir = trailingslashit( $upload_dir[‘basedir’] ) . ‘some-folder/’; … Read more
You need to specify the ID, like you did for the link and title. Try: get_the_excerpt( $recent[“ID”] )
the_excerpt() function bascially echo(es) the get_the_excerpt() function output, which in turns wraps the $post->post_excerpt value in html <p> tags. So you can either strip the html markup, <p class=”myclass”><?= wp_strip_all_tags( get_the_excerpt(), true ) ?></p> or, if you have access to the $post object simply, <p class=”myclass”><?= $post->post_excerpt ?></p>
You forgot to add get_header() , please try below code. <?php get_header(); ?> <div class=”container”> <h1><?php single_cat_title();?></h1> <?php if (have_posts()) : while(have_posts()) : the_post();?> <div class=”card mb-4″> <div class=”card-body”> <?php if (has_post_thumbnail()):?> <img src=”<?php the_post_thumbnail_url(‘smallest’);?>” class=”img-fluid”> <?php endif;?> <h3><?php the_title();?></h3> <?php the_excerpt();?> <a href=”<?php the_permalink();?>” class=”btn btn-success”>Read more</a> </div> </div> <?php endwhile; endif;?> </div> <?php … Read more
A tool like PHP CodeSniffer, combined with the WordPress Coding Standards can be used to warn you if values are not being escaped. These warnings can be shown in the editor if the editor has a PHPCS extension of some kind (VS Code does, but I’m not sure about PhpStorm). With PHPCS it’s possible to … Read more
I don’t know if I understand you correctly, but probably in the file which calls get_sidebar(): You could do something like if ( ! is_home() ) { get_sidebar(); } Or in your header.php where the main-element starts (which probably wraps the sidebar). You could give it a class if the page is not the home … Read more
Take a look at the intermediate_image_sizes_advanced filter. This filter receives the attachment ID in question, so with that you should be able to work out whether or not you want the intermediate sizes, and return an empty array if not.
You don’t That’s not how blocks work, and it’s not how HTML works. If you want multiple areas to insert blocks into, you need multiple blocks. This is the same as saying that a box has multiple insides, or that there is more than one “inside a HTML tag”, it does not make sense as … Read more