<p>
<p class="grid_9">
<?php
echo $post->post_content;
?>
</p>
</p>
But result is not what I expected:
<p> </p>
<p class="grid_9"> </p>
Post's content
Maybe someone has any ideas how to solve it?
I tried
<p>
<p class="grid_9">
<?php
echo apply_filters('the_content',$post->post_content);
?>
</p>
</p>
But the result is the same.
Nested paragraph tags don't work properly because the closing </p> is optional, you should use a div, or other container instead of your outside
The reason might be in the external plugins you have using. Please disable all plugins and try it again. Or make search in the whole project by phrase 'the_content' (including quotes) and try to comment each of them to find the reason.
I saw often in plugins bad usage of basic php/wordpress practices. It might break expected result. For example, I had the same issue in my project on PHP 7.0, because bad written filter in external plugin does not return anything.
add_filter('the_content', 'lbe_myplugin_lightbox');
I disabled it, then fixed the function and everything works fine now. Hope, it helps a bit.
Good luck!
PS It would be nice to know your PHP version as well.
Related
whitespace-pre-line seems not working for me. I've tried to copy the same code from my text editor to https://play.tailwindcss.com/ , it works like a charm. I've attached the screenshot below.
sample code in my text editor:
export default function App() {
return (
<div>
<p className="whitespace-pre-line">
Just for
demonstration
purpose
</p>
</div>
);
}
the result shows here:
sample code in play.tailwindcss.com
<div>
<p class="whitespace-pre-line">
Just for
demonstration
purpose
</p>
</div>
the result shows here:
As far as the whitespace-pre-line is concerned. The second ouput is actually the desired output.
I guess it's technical issue or your code in the https://play.tailwindcss.com/ was wrapped with some other parent classes.
For me it worked perfectly.
Just for clarity .
According to the documentation of the tailwind.
Use whitespace-pre-line to preserve newlines but not spaces within an element. Text will be wrapped normally.
For example the code:
<div class="w-3/4 ...">
<div class="whitespace-pre-line ...">Hey everyone!
It's almost 2022 and we still don't know if there is aliens living among us, or do we? Maybe the person writing this is an alien.
You will never know.</div>
</div>
And the ouput goes like:
Hey everyone!
It's almost 2022 and we still don't know if there is aliens living among us, or do we? Maybe the person writing this is an alien.
You will never know.
For more details please follow the tailwind documentation. https://tailwindcss.com/docs/whitespace
Just add the class whitespace-pre-line to the div.
<div class="whitespace-pre-line">
<p>
Just for
demonstration
purpose
</p>
</div>
This question already has answers here:
How can I put DIV in P?
(6 answers)
Closed 3 years ago.
I'm trying to validate my wordpress site for the WCAG 2.0 AA standard, it's the first time I'm dealing with it and I have this error by the html validator.
I've search some other questions about the same error but didn't help. The error is brought up on my blog page of my Wordpress site amd actually it is been shown when I have an article posted, if I remove my post then there is no error.
I also checked through my (single) article and there is no empty paragraph in there nor any non-inline elements I noticed inside the paragraphs. I include the code of the index file as shown in Chrome's developer tools, I see that it is highly recommended not to post pictures of code but I guess that in this case it's better do it that way, if I'm wrong or if I should post any other info please tell me, thank you all for your time!
Edit: Pals, thank you all for your immediate replies, I really appreciate! So I put the code on text, now, the problem is that I don't know any way to edit this piece of code, as I stated before, this is the code that is shown in Chrome developer tools and I can't find this code in any of the php or css files of the Theme. I checked the article that causes me the error, throughout the article there is only and tags inside the . Personally I haven't put any tags, nore I noticed any... I'm sorry, I understand that I'm probably not comprehensible enough but I really can't find any other way to descirbe this... Thank you all for your patience again!
Code:
<div id="wrapper">
<div id="contentwrapper">
<div id="content">
<div class="post-49 post type-post status-publish format-standard hentry category-uncategorized">
<h2 class="entry-title" id="post-49"><a f="https://badwitchstudios.gr/2020/01/21/daz-studio-blender-ue4-mixamo-tutorial/" rel="bookmark" title="DAZ STUDIO/BLENDER/UE4/MIXAMO TUTORIAL">
DAZ STUDIO/BLENDER/UE4/MIXAMO TUTORIAL </a></h2>
<div class="entry">
<p>.......</p>
<div class="belowpost">
<div class="postdate">January 21, 2020</div>
<div><a class="more-link" href="https://badwitchstudios.gr/2020/01/21/daz-studio-blender-ue4-mixamo-tutorial/">Read More</a></div>
</p></div>
</div>
</div>
</div>
</div>
</div>
Edit2: Ok case solved, I contacted the authors and they immediately located the error code and fixed for me, so it was a piece of code in the file extras.php, there was an extra space after '.get_the_date() function. The original code was:
function indigo_new_excerpt_more($more) {
global $post;
return ' '.get_the_date() .' ID)) . '">'. esc_html__('Read More', 'indigo-lite') .' ';
}
add_filter('excerpt_more', 'indigo_new_excerpt_more');
So I just had to remove the extra space after
'.get_the_date()
function and it's solved.
In your code there is pretty a chaos of opening and closing HTML-tags.
I suggest you to closer analyze where you open and close a tag and what is wrapped by the tag.
The error especially thrown in line 107 is caused, because you open three <div>s within the <p> element, but you just close two of them.
So as a first improvement, add </div> before </p>.
Then please check that you use the same amount of opening and closing tags.
I have the following problem: I have set the width of a paragraph, but it doesn't seem to have applied.
<p style="">
<center><img src="img/Arraying.png"></center>
</p>
<p style="max-width:500px;"><font size="+2"><center><b>Arraying: Web & Java Developer.</b></font>
<br>
<i>Hey, I'm Arraying. I'm the web and Java developer for Minevelop. My specialities are small, yet complex Spigot plugins, web development, and plugin configuration.
<br><br>I've been server managing since I was eleven or twelve, and over the years I have gained a lot of experiences.
<br><br>Spigot: https://www.spigotmc.org/members/_wiildanimal_.81436/
<br>Enjin: http://www.enjin.com/profile/9844615
<br>Email: arraying#minevelop.com</i>
</center>
</p>
<p style="">
<br>
<br>
<center><img src="img/DomThePotato.png"></center>
</p>
<p style="max-width:500px;"><font size="+2"><center><b>DomThePotato: Lead Java Developer.</b></font>
<br>
<i>Hello, my name is Dom, aka DomThePotato, and I am the lead Java developer here at Minevelop. I specialise in utility plugins and everything that is not minigames. With over 1 and a half years of experience, I will be able to get any request done! Also experienced file configurer and backend administrator.
<br><br>Spigot: https://www.spigotmc.org/members/domthepotat.38275/
<br>Enjin: http://www.enjin.com/profile/7005362
<br>Email: domthepotato#minevelop.com</i>
</center>
</p>
The first paragraph about Arraying seems to work fine, yet the one about Dom just doesn't want to be 500px wide.
I'm really tired, so if the error is completely stupid please forgive me.
You are using max-width I think you need to just use width:
<p style="width: 500px;"> HTML </p>
The issue is with the way your html is structured. Both tag and tags are inline elements. If you want to make all of the elemnts withing the tag stay in a max-width container, then you should try changing the tag to a tag.
Your code would look like this:
<div style="max-width:500px;"><font size="+2"><center><b>DomThePotato: Lead Java Developer.</b></font>
<br>
<i>Hello, my name is Dom, aka DomThePotato, and I am the lead Java developer here at Minevelop. I specialise in utility plugins and everything that is not minigames. With over 1 and a half years of experience, I will be able to get any request done! Also experienced file configurer and backend administrator.
<br><br>Spigot: https://www.spigotmc.org/members/domthepotat.38275/
<br>Enjin: http://www.enjin.com/profile/7005362
<br>Email: domthepotato#minevelop.com</i>
</center>
As #Hans Strausl mentioned, your HTML tags aren't nested properly (I believe you want the <center> tag to wrap the <font> tag, but you can always reverse them again if I've misinterpreted). Also, changing the <p> tags to <div>s seemed to achieve what you're looking for.
Here's a fiddle. https://jsfiddle.net/wzazrn5p/
I am trying to make a website that has a contents page.
I use the go to chapter 1 as the contents part,
and when it clicks it does to the <a name="chapter1"><u>Chapter 1</u></a>
This works well, but there's 1 catch (there's always a catch)...
I want to make it look like the ones on Wikipedia:
[View Image][1]
[1]: http://crystalanalysis.anydns.com/images/wikipedia_contents.png
But I didn't want to copy the one from Wikipedia, I wanted to make my own,
I looked around, found the parts I needed and had 2 problems! The first problem I am
having has something to do with the Indent. I tried using the p.indent {text-indent:150px}
but it only did the indent for the line I put it before. So:
Indented text
But it was annoying having to put the Indented text before every single line in the
contents box, but it works:
<header>
p.contenttitle {text-indent:50px;}
p.contentsub {text-indent:100px;}
</header>
<body>
<div style="background-color:#FFFFFF;width:1024;border:solid 1px #000000;"><br>
<font class=Blackverdana><b>Contents:</b><br></font>
<div align="left">
<!-- CONTENTS a href --><font class=Blackverdana>
<p class=contenttitle>Chapter 00: First things first...
<p class=contentsub>Chapter 0.2 Finding the SDK for your game
<p class=contentsub>Chapter 0.3 Running the Hammer Editor
<p class=contentsub>Chapter 0.4 First Load<br><br>
</body>
The other problem I am having is that if you look at the contents page:
http://crystalanalysis.anydns.com/7-12-2013.html
you will see that there seems to be some sort of <br> after every line.
I did not plan to have those there, they just appeared. Maybe a connotation with the "p" tag?
Any help would be greatly appreciated
And also the website is a blog and I am making a Hammer Editor Tutorial if anyone was wondering.
So it seems that you aren't ending the tags when you first start them.. An example of this:
<p class=contenttitle>Chapter 00: First things first...
When in all reality it should be:
<p class=contenttitle>Chapter 00: First things first...</p>
That could be a possible issue, as well as you should really look into using a CSS page to reference your HTML. Creating a class/id will actually make that indentation process ten times easier. For more information on that I can provide a handy link from w3.org that can explain the entire process of using CSS and how it can make your life a lot easier!
http://www.w3.org/Style/Examples/011/firstcss.en.html
Here is the cake code..... notice the $email_body
<?php
$this->Email->reset();
$this->Email->delivery = 'smtp';
$this->Email->smtpOptions = array(
'port'=>'465',
'timeout'=>'30',
'host' => 'ssl://smtp.gmail.com',
'username'=>'noreply#example.com',
'password'=>'a_password_you_cant_see',
);
$this->Email->sendAs = 'html';
$this->Email->template = 'default';
$this->Email->from = '"NO-REPLY" <noreply#example.com>';
$this->Email->to = "rakib#example.com";
$this->Email->subject = "test PHP html email";
$email_body = "Hello message body
<hr />
This is rakib
<br />
<table width=\"100%\" bgcolor=\"#ff0\">
<tr>
<td>
In a table
</td>
</tr>
</table>";
$this->Email->send($email_body);
?>
After sending this email out, when I view the Original mail contents via the Show Original button from GMail's drop down menu [at top-right corner of an email], here is what the HTML looks like:
<!-- Starting to render - email/html/default -->
<p> Hello message body</p>
<p> <hr /></p>
<p> This is rakib</p>
<p> <br /></p>
<p> <table width="100%" bgcolor="#ff0"></p>
<p> <tr></p>
<p> <td></p>
<p> In a table</p>
<p> </td></p>
<p> </tr></p>
<p> </table></p>
<p> </p>
<!-- Finished - email/html/default -->
<p> and </p> tags got included at EVERY new line..... why is that? Using CakePHP 1.3
When doing anything with emails, try and stick to the MVC principles. By writing your email's HTML (view) in what is likely to be a controller can make things a little messy and tends to bloat your code (e.g. composing markup in your controller).
Use templates to author the structure of your email and then use view variables ($this->set(...)) to apply specific values to it (See documentation).
I'm afraid I don't know why <p> tags are being inserted but I suspect it has got something to do with the newline character \n which is implicitly inserted each time you hit the return key.
In summary, move your markup to the template and everything should be better.
If you're directly setting the body of the email, CakePHP expects the text passed to be plain text.
By setting the type of email to HTML (Email->sendAs = 'html'), CakePHP will create a HTML version of your plain-text body by converting new-lines to <p> tags
In your case, you pass HTML as message body, but CakePHP assumes it is plain-text, therefore converts new lines to <p> tags as well
Read the documentation here: Sending a basic message
note
Although this should explain your question, please look at the answer that Sam provided as that will give you an answer on how you should send an HTML email!
I found the solution to this... I needed to create my own default.ctp file in my app folder at app/views/elements/email/html/default.ctp and put the following in the file
<?php
echo $content;
That solved my problem. Please look below for the analysis of this problem.
[P.S. I did the same thing for app/views/elements/email/text/default.ctp for text based mails to print correctly]
The problem was that, since i didn't declare any default.ctp element in my own app folder, cake was falling back to the view element in its own core lib folder at cake/libs/view/elements/email/html/default.ctp . Over there, this is what it does.
<?php
$content = explode("\n", $content);
foreach ($content as $line):
echo '<p> ' . $line . "</p>\n";
endforeach;
?>
That's where the <p> tags were coming from at every new line. Thanks to #thaJeztah's answer. In order to avoid this from happening, i needed to create my own default.ctp element in my app folder that would eventually override the default.ctp element in the core's lib folder.
That's one bad case scenario.