Custom field coming oddly in widget

Hi,

Question is related to old thread about chaning layout . As you recommended to use Show Expert code, It works partially, thanks.

I wanted to show custom filed with in output of the widget I have updated the code as follow:

. $excerpt
.'<p>'.the_field( 'ingress', get_the_ID() ).'</p>'
. '</div>'

however custom field shows out of the container at the top. please check screenshot

Also it adds code tag which should not be there as per WCAG standards, since this site should be WCAG competible.

Thanks for your help. much appriated.

Hi @funkweb,

I guess there are some div tag in your custom field text break the p tag.

So please update your code to this:

. $excerpt
.'<div class="ingress">'.the_field( 'ingress', get_the_ID() ).'</div>'
. '</div>'

Hope it helps :slight_smile:

Hi Thai,

Thanks for quick reply, I tried it but it does not change nothing on front end.

Hi @funkweb,

Would you mind providing us with login credentials(by clicking on the Secure Note button at the bottom) so we can take a closer look? To do this, you can make a post with the following info:

  • Link login to your site
  • WordPress Admin username / password

Thanks.

Hi,

I just did, and In addition, a quick question: can the posts come with pagination?

Thanks

Hi @funkweb,

You should use get_field instead of the_field because the_field will force display the value of the field.

So kindly change:

.'<div class="ingress">'.the_field( 'ingress', get_the_ID() ).'</div>'

to

.'<div class="ingress">'.get_field( 'ingress', get_the_ID() ).'</div>'

Here are some links for the comparison of the two functions:


As for the pagination using the recent post element, it could be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.

Thanks for understanding. Take care!

Thanks Jade,

Can you point me to right direction towards documentation of X theme?

Thanks

Hi @funkweb,

Do you mean specifically for the ACF integration to X?

If so, you can check it from here:

If you are looking for resources for X, you can check our Knowledge Base where you can find an ample of information and tips about X.

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.