Tags » WP

Can't add_action to 'save_post' and get it to fire

I’m trying to add an action every time someone presses the ‘Publish’-button. I’ve made this function:

function custom_set_category_on_cpt( $post_ID, $post, $update ) {

echo '<p>This does not show, unless I hook it onto admin_head or admin_footer</p>';

if ( 'publish' === $post->post_status ) {

  echo '<p>I can't get anything in here to show... 80 more words

Walker menu not displaying at all

I am having trouble trying to get a menu with dropdowns to work. This is the non-wordpress menu:

<ul class="nav navbar-nav" data-in="fadeInDown" data-out="fadeOutUp">
    <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown" >Dropdowns</a>
        <ul class="dropdown-menu">
            <li><a href="#">Custom Menu</a></li>
            <li><a href="#">Custom Menu</a></li>
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" >Sub Menu</a>
                <ul class="dropdown-menu">
                    <li><a href="#">Custom Menu</a></li>
                    <li><a href="#">Custom Menu</a></li>
… 443 more words

when i choose category from dropdown then evrythng working fine.But in backend it checked only child not parent

  1. Here my Code
<?php if(isset($_POST['new_post']) == '1') {
    $post_title = $_POST['post_title'];
    $post_category = $_POST['cat'];
    $post_content = $_POST['post_content'];
    $parent = get_the_tags($post_category);;

    $new_post = array(
          'ID' => '',
          'post_author' => $user->ID, 
          'post_category' => array($parent,$post_category),
          'post_type' => 'currencies',
          'post_content' => $post_content, 
          'post_title' => $post_title,
          'post_status' => 'publish'

    $post_id = wp_insert_post($new_post); print_r($post_id);
    // This will redirect you to the newly created post
    $post = get_post($post_id);    echo "Done";
    }       ?>   

<h1fhsdfh</h1> <form method="post" action=""> 
    <label>Post-Title:-</label><br><label><input type="text"  class="form-control"  name="post_title" size="45"
<label>Catogries:-</label><br><label > <?php
?> </label><br>

    <label>Content:-</label><br><label><textarea  class="form-control"  rows="5" name="post_content" cols="66"
    <input type="hidden" name="new_post" value="1"/> </label>
    <input class="subput round form-control"   type="submit" name="submit" value="Post"/> </form> <?php get_footer(); ?>

Comment Section

Ok so , I am using Elementor for my page building process. I would like to have my comment section BEFORE my sectioned footer.

I don’t want the bottom section of the comments to be visible. 9 more words