The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [html]

Covers all flavors of HTML: HTML5, XHTML and old-school HTML 4.

Filter by
Sorted by
Tagged with
2
votes
4answers
17k views

ajax live search for post title

i m creating a AJAX live search to filter posts title in my wordpress theme. As i write something in input it show all the post in result, Not filtering it to get custom post.. How to search live ...
10
votes
6answers
29k views

WordPress Admin Bar Overlapping Twitter Bootstrap Navigation [closed]

I am having an issue with the WordPress admin bar overlapping the Twitter Bootstrap (2.3.0) nav bar. I have tried this fix: body.admin-bar .navbar-fixed-top { top: 28px; } .navbar .brand { ...
10
votes
2answers
3k views

How to add crossorigin and integrity to wp_register_style? (Font Awesome 5)

I am upgrading Font Awesome 4 to version 5 which introduces both integrity and crossorigin attributes to the <link rel="stylesheet"> markup. Currently, I am using: wp_register_style('...
8
votes
3answers
5k views

start_lvl Ignored in Custom walker_nav_menu

This is my first project involving WordPress and I've got stuck trying to create a custom walker for a footer menu. I basically want to change the menu from the <ul> <li></li> </...
0
votes
1answer
6k views

How execute shortcode with javascript

Suppose to have this shortcode: [spu-close class="" text="" align=""] I want to show this short code when I click on a button this is my html: <input class="button b" onclick="openFile(link);" ...
12
votes
5answers
27k views

Keep HTML format when switching from Visual to HTML editor

I've been looking around for a solution that will allow me to edit HTML code and have it remain after a switch to the Visual editor and back. I've tried a bunch of things with no luck: the wp-no-...
10
votes
1answer
7k views

How can HTML be allowed in Author Bio?

Is there a way to prevent WP from stripping the HTML from the author bio? I need it to keep my paragraphs. Thanks in advance! :) Edit - Although this question has been answered, I will clarify that ...
5
votes
2answers
6k views

How to customize the default HTML for Wordpress Attachments

I'm using Wordpress 3.0.1 (most recent as of now) and working around the Whiteboard theme. It seems that for attachments (images, specifically), Wordpress generates the HTML automatically and it ...
4
votes
1answer
271 views

Can I force WordPress to use <i> instead of <em>?

For example, Did you know that <em>hot</em> was used to mean "<a title="What is the origin of “hot” as “good-looking” or “attractive”?" href="http://english.stackexchange.com/a/84227/...
2
votes
1answer
4k views

HTML code in Custom field

I'm using a custom field to display images in a slider on each post, but when I update the post after having entered the HTML code in the custom field, the code disappears. I'm assuming that there is ...
1
vote
4answers
3k views

HTML / Javascript in custom field textarea?

Is there a filter for allowing HTML / Javascript into a custom field textarea? I'm using get_post_meta. On the frontpage I want the HTML / Javascript to run, not to be displayed.
1
vote
1answer
3k views

Custom title widget / HTML encoding

I'm not the first person who has battled the matter of WordPress stripping HTML from widget titles. There are a number of custom widgets out there that allow you to add e.g. links to titles, but I ...
1
vote
1answer
1k views

Change Default Image HTML

I am making a Wordpress theme and want to change the default image html. For example if you upload an image using Wordpress uploader it generates the following html for your images <a href="...
0
votes
1answer
405 views

Load custom field value into div with AJAX

I have 3 different custom fields url-1, url-2 and url-3. Each field have different value in type of <iframe> embedded video. Click any link <li> and play that video, By default play url-...
41
votes
4answers
75k views

Is there a way to send HTML formatted emails with Wordpress' wp_mail function?

Is there an action_hook or something similar that could help me achieve this? I tried adding markup in a PHP string variable and just fired off an email with the wp_mail function like so: $email_to =...
9
votes
4answers
6k views

dealing with large HTML output via plugin code

I recently wrote my first WP plugin that adds a shortcode for embedding a custom jquery image gallery into posts. It's primarily just dumps a good chunk of HTML into the post, along with javascript ...
8
votes
4answers
6k views

How can I alter the [gallery] markup?

I would like to change the markup created by [gallery] from what is it as standard (dl) to a unordered-list with a difference. Below is the desired markup: <ul> <li><a href="/path/...
10
votes
4answers
18k views

I want to have my custom field use HTML, how do I do that?

I want to have my custom field use HTML, how do I do that in such a way that I can use a rich text editor to view the content?
7
votes
3answers
21k views

How do I change/modify the_post_thumbnail(); html output?

I'm working on building out a custom theme and have been struggling with this one for a bit. I am trying to modify the HTML output of the_post_thumbnail(); function. I need to do this because I am ...
5
votes
2answers
4k views

When switching from html to visual editor the <iframe> tag gets corrupted

I'm trying to embed an iFrame, and because I set up some CSS using responsive design, I wish to NOT have width="" and height="" attributes whatsoever. When I type this into the HTML editor field.. &...
4
votes
1answer
312 views

Allowing more elements in comments via functions.php

I would like to allow certain HTML elements in my comments and have edited kses.php directly in the past. However, I have been hacked recently and replaced all the core Wordpress files and feel I ...
2
votes
2answers
6k views

How do I stop HTML entities in a custom meta box from being un-htmlentitied?

I have a custom meta box that is supposed to accept HTML, but the text I'm trying to input contains both double and single quotes (and ampersands), and it's messing up the saved data - each time I ...
2
votes
2answers
330 views

Why is WordPress WYSIWYMG and how do I make it WYSIWYG?

WordPress may have a text editor that appears to be WYSIWYG, but upon using it I discovered that it is actually WYSIWYMG- What You See Is What You Might Get (once it's done screwing with the HTML). ...
1
vote
4answers
4k views

How to wrap every image in a post with a div?

When I add an image to a post I want it to be in a div e.g. , and I want that to be done automatically, so I don't have to do that in HTML editor. I don't want to use js to accomplish this and by the ...
3
votes
2answers
2k views

strip only specific tags (like <p>), but keep other tags (like <br/>)

I know it's easy to disable Wordpress from adding both p and br tags with: remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'wpautop' ); but I want Wordpress to keep adding &...
3
votes
1answer
2k views

How to Add Admin Bar and Admin Menu or Submenu Notification Bubbles?

What would you recommend to use as far as manipulating the admin bar goes? I was thinking to just add a new admin bar node, and with CSS set a background image for the icon. Then in the node, just ...
2
votes
1answer
816 views

How to wrap the content of the main tinyMCE editor with extra tags

I'm on WP 4.6, which has tinyMCE 4. I need to make the contents of my post editor visual tab more WYSIWYG. I'm attaching a CSS file containing my front end styles to the editor using add_editor_style. ...
1
vote
4answers
11k views

alt, title tags not showing

I have added alt tags, title and description on all the images on my website but none are showing when I check them in the inspect element tool in chrome or firefox. Here's a screenshot: And here's ...
1
vote
1answer
2k views

Edit raw HTML of the landing page

I just created and set up a landing page for my blog. I use Weaver theme. I checked every checkbox to remove all the stuff I don't want ( Hide Page Title, Hide Site Title/Description, Hide Menus,...
0
votes
1answer
1k views

Unfiltered html in widget title not working

function update( $new_instance, $old_instance ) { if( current_user_can( 'unfiltered_html' ) ) { $new_instance['title'] = strip_tags( $new_instance['title'], '<small><span>&...
6
votes
1answer
888 views

Why doesn't default Wordpress page view use force_balance_tags?

I noticed that the default WP theme uses force_balance_tags for listing posts' excerpts. This way, it doesn't cause major html breakage whenever someone writes a post like <div><b>This is ...
4
votes
1answer
527 views

Correct regex for wp_embed_register_handler

THE GOAL I'm trying to parse a url and convert it to an embedded video player in my post's content but I think my regEx is off or I'm not creating a provider correctly. THE CODE Here is what I have ...
4
votes
5answers
28k views

How do I use Shortcodes inside of HTML tags?

I tried to include shortcodes with a parameter in raw html output, like shown below: <a href="https://example.com/folder/edit.php?action=someaction&id=[foocode parameter='value']&edittoken=...
3
votes
1answer
901 views

WordPress Shortcode and Dynamic CSS

I have a question I would like to ask to the WordPress developers, Usually when creating a shortcode that need to generate custom css how do you proceed? For example a simple button shortcode with ...
2
votes
2answers
6k views

How do I make wordpress comment fields required?

Here is my form: <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform" class="validate"> <?php if($user_ID) : ?> <?php ...
2
votes
1answer
2k views

Add visual editor capability to custom excerpt window?

The custom excerpt field (under Add New Post) only accepts html. Thus, you can't just cut and paste a segment from the Visual Editor. If you want links to appear in custom excerpt, you have to know ...
2
votes
4answers
2k views

Localizing a string with html tag with word inside that tag

I have translated many string successfully previously, but this one gives me a headache. This part is used inside my content-related.php file which I use to display related posts Here is the current ...
1
vote
1answer
69 views

How do I edit the php/html for a particular post?

I am new to Wordpress but I am comfortable coding in html/php and want to create custom forms on some of my posts. My site is currently running on localhost. I feel very silly because I have been ...
1
vote
1answer
2k views

Conditional statement for parent, child and grandchild pages

I'm trying to figure out how to set up a conditional statement to check if the parent, child or grandchild is being displayed. This is what I've got so far: <?php if ( is_page( 'about' ) || '29' ...
1
vote
1answer
7k views

customize comment form

I want to change the titles "Name", "Email", and "Website" in my comment form?. How could I do this? I thought by changing them in this field would work ( 'Website', 'domainreference' ) but it doesn'...
1
vote
2answers
10k views

Edit HTML of Wordpress navigation bar

Is there a way to change the html of my wordpress page's navigation bar? (I'd like to add in several divs that will be controlled with media queries.) Thanks for reading!
0
votes
1answer
270 views

Correct way to make static pages editable in wordpress

I am in the process of converting a small static website with 5 pages into a WordPress site. I have created a custom theme and created the pages (Home, About Us etc) from the Wp backend. I have ...
0
votes
1answer
96 views

get_post_custom stripping styling issue

I found this thread: Paragraphs removed when using get_post_custom()? Was hoping someone could either help me a little more though.. My code: <?php $post_customs = ...
0
votes
1answer
27 views

Remove Line Breaks From Cell Content in WordPress

A line break in a table cell is converted to ⟨br ⁄ ⟩ when it is saved. I must remove all line breaks from the cell content else there is excessive space between paragraphs, list items, etc. It makes a ...
0
votes
2answers
191 views

Paragraphs removed when using get_post_custom()?

I'm using a custom field plugin called Advanced Custom Fields to create custom fields, but i don't think that's what's causing the problem. When i fetch the custom fields from a template using ...
0
votes
2answers
2k views

Multiple pages on one with different HTML

I am a bit confused on how this may be achieved. I have a website that I have coded already with static HTML/CSS and I am trying to incorporate it into wordpress. The challenge though is that the ...
0
votes
1answer
169 views

Thumbnail + Excerpt = loss in word count

My excerpts are shown using this function <?php function get_the_content_limit_custom_allowedtags() { // Add custom tags to this string return '<script>,<style>,<br>,<...
0
votes
1answer
3k views

Category Descriptions - HTML?

Is it possible to allow HTML to be rendered in Category descriptions? My theme uses them quite a lot, and I'd like to style them better with images and links. This seems to be do-able from what I ...
0
votes
2answers
1k views

How to use a frontend URL with a Plugin

I want to use a URL to display content in the frontend. For example domain.tld/?myplugin&confirmey=KEY&mail=MAIL But i don´t know the way(s?) to do it. For example i have a user that clicks ...
0
votes
2answers
2k views

Blank <title> on static home page?

The <title> of each page on my site shows correctly with the following code: <title><?php wp_title(''); ?></title> But on my home page, which is set to a static page called '...