Archived topic
Content below Posts on category page
44 replies · Started by Marius on September 11, 2019
Can you try this filter code:
add_filter( 'generate_hook_element_display', function( $display, $element_id ) {
if ( 10 === $element_id && is_paged() ) {
$display = false;
}
return $display;
}, 10, 2 );
Again you need to change the ID #
Okay, now it seems to be working. I only see it on page 1. What was the problem?
And can you also tell me how to solve the other problems with the design?
The filter was missing a couple of arguments in the last line of the code.
So add your markup within a DIV container like so:
<div class="inside-article after-archive-container">
<!-- add your content here -->
</div>
Then add this CSS:
.after-archive-container {
margin-top: 20px
}
Thanks, that looks good now.
Still two questions:
1. Is it possible to put the pagination box below the content?
2. What is the meaning of the numbers 10, 2 in the filter?
Now, since I insert content, there is nother problem. In this hook Section no line breaks are displayes an also the titles looks strange.
The content there should be look like on a normal page. What to do?
Did you copy and paste the content?
Can you make sure that all of the normal text is inside <p></p> tags.
Yes I have copy and paste.
I have put the contetn in <p></p> but nothing changes. Yes ihave delete the cache.
I am still not seeing any P tags around the text which is the reason the format is breaking.
If you copied the content from another post, can you switch to the Text editor view ( not Visual ) and you should be able to see the P tags there, copy and paste that content.
I would advise flushing the cache and disabling when making these changes and then re-enable it once you are done. Caches can cause a lot of pain otherwise.
I have clear and disable the cahce again.
I only use the text editor, never the visual one. So i copied from text editor. And i can assure, that i have put the contetn in those <p></p> tags.
The problem persists.
I'm not seeing <p> tag either.
Perhaps there are some HTML errors? Like an open tag without closing?
I see an empty paragraph at the very top:
https://www.screencast.com/t/Xaxaqja3fM
You'd need to go through the entire thing carefully to make sure there aren't any errors there.
In a incognito browser without cache an login I can see clearly a <p> tag before the first h2 and a </p> after the last sentence in the sourcecode.
Each paragraph needs an opening <p> and a closing </p> (similar to what you have for <h2>)
So your structure would be something like this:
<h2>Allzeit bereit mit EDC</h2>
<p>Description paragraph</p>
<h2>Was sind typische EDC Tools?</h2>
<p>Description paragraph</p>
Might be beneficial to go through a tutorial like this?
https://www.w3schools.com/html/html_paragraphs.asp
grmpfff .. Each sentence in these tags? Or only each paragraph? And what about line breaks?
Why it is not possible, to write normal like in text editor?
You can actually see how this works here:
https://www.w3schools.com/html/tryit.asp?filename=tryhtml_paragraphs2
That's just how the text editor works - GP actually doesn't have its own editor.
Okay, but I use wordpress for about 10 years and i have always worked in the text editor. I have never used p tags in there.
If i press return, then i automatically get a line break. Why this is not possible in the hook?
Cause i wanted to put a lot of text in many category sites like this. But it is simply not doeble, if i have to put a p tag around each sentence. I want to focus on my text and not on the code.