How to add an HTML tag to the Header?

The hook you’re looking for is wp_head. functions.php add_action( ‘wp_head’, ‘se343581_add_preload_tag’, 5); function se343581_add_preload_tag() { echo ‘<link rel=”preload” href=”‘. plugins_url(‘/gdpr-cookie-compliance/dist/styles/lity.css’) . ‘” as=”style”>’; // // — if added in plugin file — // echo ‘<link rel=”preload” href=”‘ . plugin_dir_url( __FILE__ ) . ‘some_subdir/file_name.css” as=”style”>’; }

Display “large” image size and show caption in attachment page

I’ve tested the following and it works for me. This uses the image’s Title for the ‘alt’ text and displays the image’s caption below the image itself. Use this in content-attachment.php, replacing the current the_content function: $attachment_id = get_the_ID(); // If this attachment is an Image, show the large size if ( wp_attachment_is_image( $attachment_id ) … Read more

post edit button on front end

The function is edit_post_link() (see Codex or source). In TwentyEleven it used as follows in content.php edit_post_link( __( ‘Edit’, ‘twentyeleven’ ), ‘<span class=”edit-link”>’, ‘</span>’ ); You can simply use the function as indicated above (or in the Codex) in a custom template, but it must be used inside the loop. There’s no need to perform … Read more

Routing dynamic numeric slug to custom template

The easiest way is to simply create a custom rewrite endpoint. This is a two-fer. It will create our actual permalink structure and our query var in one go. Do note that after creating the below you will need to resave permalinks: Settings -> Permalinks -> save button. /** * Create Careers Endpoint * * … Read more

WordPress Shortcode wrap around div

If by template file you mean a php file in the themes folder, you can call do_shortcode to have the shortcode processor do its magic on your div. EDIT: not entirely sure I understand what you want, but you could try this: <div id=”subscription”> <?php do_shortcode(‘[subscribe]’.call_php_function().'[/subscribe]’);?> </div>

What should I put on my index.php?

index.php is shown whenever wordpress doesn’t find an appropriate page template. Generally people use it as the template for their site’s blog. If you are absolutely sure that it will never be reached, you can leave it empty. Just make sure you have that file present, otherwise the theme will not work As a personal … Read more

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