Get the required Contact Form

I have 2 froms in my web site, but i need get only Selected form, for current post/page:

<?php  $  posts = get_posts(array(     'posts_per_page'    => 1,     'post_type'         => 'roads' ));     if( $  posts ): ?>           <?php foreach( $  posts as $  post ):               setup_postdata( $  post );              ?>                  <?php $  form_posts= get_field('form', $  post->ID);                         echo $  form_posts;                  ?>                 <?php echo do_shortcode( '[contact-form-7 id="'.$  form_posts.'" title="Form" html_class="contact-form"]' ); ?>          <?php endforeach; ?>          <?php wp_reset_postdata(); ?>  <?php endif; ?> 

But i can get only on form, for all post/page – where i’m wrong? i want get this in my single page for post type. Thank you

Adding shortcodes to multiple pages with function

I am building a plugin that allows users to display information to the front-end of a website.

When users want to display this information they have to add in a shortcode to the page they would like to display the data on. However if a user wants to display this info on every single page then they will have to add this shortcode to each page. Is there a way to automate this process? Can this also be achieved by the use of a single function?

Is it possible to have dedicated page for parent/child taxonomy?

I’ve been working non-stop on this for the past few days. I have a post type, floorplan, which has a hierarchical taxonomy called County. Each County taxonomy has child taxonomies with the names of communities within each county, which I’ve been able to apply to the post permalinks by following This Guide. So my post urls are now floorplans/{parent-county}/{child-county}/{the-floorplan}

Now, I have a custom county-taxonomy.php template that displays all posts of this type that have the county taxonomy assigned. The url is floorplans/{parent-county} where parent county is the parent taxonomy. This template will also display if you navigate to the url floorplans/{child-county} where child-county is the child taxonomy.

HOWEVER, if I try to navigate to floorplans/{parent-county}/{child-county}, I get a 404.

So my basic question, is it possible to modify the permalink of the taxonomy page such that it includes both parent and child?

Possible to remove taxonomy from permalink if uncategorized?

I’m working on a client’s website who requested that the custom search functionality I’m building out provide a number of ‘pretty’ permalinks that they can use for ad campaigns.

The post types I’m working with are community, floorplan, and ready-made homes, and they want to be able to have direct links to search results by county and community.

To achieve this, I set up taxonomies that would create nicely formatted URLS such as {county}/{community}, {county}/{community}/{floorplan} {county}/{community}/{ready-made}.

This is all working fine, however it leads to some issues. For example, If you do not specify a county in your search, you will get links like uncategorized/{community} returned in the results.

Is there any way that you can remove uncategorized taxonomy from the URL, but leave the taxonomy in if it exists?

I’ve figured out how to update the URLs in the search results, however they will lead to 404s if left completely empty because they technically don’t exist if you remove the taxonomy from the url. Ideally, I would want them to just redirect to communities/{community} for example, instead of communities/uncategorized/{community}

How to show only homepage in google results instead of privacy, contact pages

When I search my website in google, all the pages and posts can see. I want to make only homepage visible in search results and remove other pages(privacy, contact etc). And also all the posts can visible without snippet. I want to fix this. Please help me. enter image description here

WordPress “Site Health Status” trust it or myself for its security advice?

I’m using WordPress to host a few sites. Lately it includes this feature called Site Health Status. This information has in part been valuable, but it also itches me the wrong way somehow that I can’t get it to show "green" due to something I’d consider non-issues 😉

Here is how the "critical issue" looks.

Relevant snippet from Site Health Status

Here’s the relevant text excerpt, because search engines aren’t all too good with indexing text from screenshots:

1 critical issue

Background updates are not working as expected [Security]

Background updates ensure that WordPress can auto-update if a security update is released for the version you are currently using.

  • Warning The folder /vhosts/sitename was detected as being under version control (.hg).
  • Error Your installation of WordPress prompts for FTP credentials to perform updates. (Your site is performing updates over FTP due to file ownership. Talk to your hosting company.)

The folder /vhosts/sitename is indeed under version control and the actual blog is under /vhosts/sitename/blog and that’s what the web server serves as webroot. However, /vhosts/sitename/wp-config.php contains the blog configuration. As WordPress allows it to live outside of the webroot, that’s what I opted for out of security reasons. Anyway, the conclusion from this first (yellow) point should be that there’s no way anyone could glean the contents of the version control system, since it lives entirely outside the webroot.

The second (and red) point is about FTP credentials. This one I find particularly unnerving. I have scripts in place, I have 2FA, and the servers in question are only accessible via SSH (and by extension SFTP). WordPress doesn’t support SFTP nor would I want to enable this at all. In fact the files inside the webroot have tight file modes so that even in case a breach occurred very little could be done. In other words, I am updating WordPress in a semi-automated fashion triggered manually. Unlike some setups of WordPress I have seen or administrated in the past with FTP enabled, I haven’t had a breach, going by all the indicators I have available. So to me this is the desired setting. But someone decided to categorize this as a critical issue.

So my questions (two actually):

  • Is there a way to dismiss and ignore these exact two items in the future?
  • Should I trust some WordPress dev who doesn’t know my exact setup more for security advice than myself or should I spend (mental) energy on actively ignoring the issue (under the assumption that it can’t be dismissed and ignored for the future)?

NB: I am not interested in having the overall feature (or the visible widget) removed. I simply want this feature to be valuable and that means not raising the alarm when nothing is wrong, as far as I’m concerned.

How would I go about replacing this function in my child theme located in inc/template-tags.php

How would I replace this function that lies inside inc/template-tags.php in my parent theme

function theme_navigation() { ?>                  <div id="theme-nav-container">             <nav id="site-navigation" class="main-navigation">                 <?php wp_nav_menu( array('theme_location' => 'theme-studios-primary', 'menu_class' => 'sf-menu', 'fallback_cb' => false, 'walker'  => new theme ) ); ?><div class="clearfix-pro"></div>             </nav>             <div class="clearfix-pro"></div>         </div>                  <!-- close #theme-nav-container -->                   <?php } 

There is no add action that it is hooked on to, there is no check to see if the function already exists. How would I replace it without touching the parent theme. I have removed much of the code in the function for brevity but I think it still makes sense.

Thanks ahead of time