Viewing 26 posts - 1 through 26 (of 26 total)
  • Author
    Posts
  • #666518

    my site saywhat.reviews

    We can not call files from
    how to properly call newly added files in child-theme, like metabox.php, newly added functions code in functions.php

    can you advise how we do this please.

    #666965

    Hey Geoffdoyle,

    Have you tried:

    include "metabox.php"
    

    Best regards,
    Josue

    #668461

    Hi,

    I have added several files in functions.php in child-theme, in my local server
    they are working 100% fine, but once I upload them into the live site, they were
    throwing errors like “Warning: include_once”

    I have all the files in the right folder and checked them via FTP, permission was
    changed to 755 also. Not sure why the functions.php won’t see my attached file.

    Attached are images from FTP and my codes.

    http://i64.tinypic.com/2s6okrk.jpg
    http://i63.tinypic.com/29aqn1g.jpg

    Thanks a lot!

    #668499

    Hi,

    When I visit your site I do not see any errors on frontend or in console. Everything seem to work fine did you get this sorted?

    Best regards,
    Vinay

    #668503

    no this is an ongoing problem that we have been working on. We have moved every thing to a new site saywhat.reviews/Reputation

    #668787

    Hi,

    Your include codes were looking for files at the root of the instance (/library/..):

    include_once('/library/custom-post-type.php');
    include_once('/library/good-form.php');
    include_once('/library/bad-form-new.php');
    include_once('/library/bad-metabox.php');
    include_once('/library/good-metabox.php');
    include_once('/library/page-metabox.php');

    Should be:

    include_once('library/custom-post-type.php');
    include_once('library/good-form.php');
    include_once('library/bad-form-new.php');
    include_once('library/bad-metabox.php');
    include_once('library/good-metabox.php');
    include_once('library/page-metabox.php');

    I’ve already changed them.

    Best regards,
    Josue

    #669554

    Thanks we seem to be moving forward.

    We do have another problem.

    Can you please help why the shortcode form is being rendered on top of the page, even though it is set up in layout builder in the bottom.

    please check the screenshot

    http://i66.tinypic.com/2u7lzrq.jpg
    http://i66.tinypic.com/2igzwy0.jpg

    #669564

    Hi,

    Is that a plugin shortcode? what’s the source of it?

    Best regards,
    Josue

    #669590

    Hi Josue

    It is some code that we have created. But we cant get it to work with enfold

    #669598

    Paste the code here so we can inspect it.

    Best regards,
    Josue

    #669601

    <?php ob_start();

    function bad_review_form() {

    $title = “”;
    $cemail = “”;
    $phone = “”;
    $content =””;
    $title_error =””;
    $cemail_error =””;
    $phone_error =””;
    $content_error =””;
    $cats =””;
    $post_tags =””;
    $hasError =””;
    $link =””;
    $terms =””;
    $facebook =””;
    $google =””;
    $business_name =””;
    $bemail =””;

    if( ‘POST’ == $_SERVER[‘REQUEST_METHOD’] && !empty( $_POST[‘action’] ) && $_POST[‘action’] == “new_post”) {

    if(trim($_POST[‘title’]) === ”) {
    $title_error = ‘Please enter your Subject’;
    $hasError = true;
    } else {
    $title = trim($_POST[‘title’]);
    }

    if(trim($_POST[‘cemail’]) === ”) {
    $cemail_error = ‘Please enter your email address.’;
    $hasError = true;
    } else if (! preg_match(‘/\.([^\.]*$)/’, trim($_POST[‘cemail’]))) {
    $cemail_error = ‘You entered an invalid email address.’;
    $hasError = true;
    } else {
    $cemail = trim($_POST[‘cemail’]);
    }

    if(trim($_POST[‘phone’]) === ”) {
    $phone_error = ‘Please enter your Phone’;
    $hasError = true;
    } else {
    $phone = trim($_POST[‘phone’]);
    }

    if(trim($_POST[‘content’]) === ”) {
    $content_error = ‘Please enter your content.’;
    $hasError = true;
    } else {
    $content = trim($_POST[‘content’]);
    }

    //$tags = $_POST[‘post_tags’];
    // ADD THE FORM INPUT TO $new_post ARRAY
    $new_post = array(
    ‘post_title’ => $title,
    ‘post_category’ => $business_name, // Usable for custom taxonomies too
    ‘post_status’ => ‘publish’, // Choose: publish, preview, future, draft, etc.
    ‘post_type’ => ‘bad’, //’post’,page’ or use a custom post type if you want to
    ‘post_content’=> $content,
    ‘cemail’ => $cemail, //url of the site
    ‘bemail’ => $bemail,
    ‘phone’ => $phone //url of the site

    );

    if($hasError != ‘true’){
    //SAVE THE POST
    $pid = wp_insert_post($new_post);
    // if ($_FILES) {
    // foreach ($_FILES as $file => $array) {
    // $newupload = insert_attachment($file,$pid);
    // $newupload returns the attachment id of the file that
    // was just uploaded. Do whatever you want with that now.
    // }
    add_post_meta($pid, ‘cemail’, $cemail, true);
    add_post_meta($pid, ‘phone’, $phone, true);
    update_post_meta($pid, ‘bemail’, $_POST[‘bemail’]);
    // update_post_meta($pid, ‘facebook’, $_POST[‘facebook’]);
    // update_post_meta($pid, ‘google’, $_POST[‘google’]);
    //add_post_meta($pid, ‘taxonomyName’, $taxonomyName, true);
    //to insert taxonomies
    wp_set_object_terms($pid, $_POST[‘terms’], ‘business_name’);

    }
    //SET OUR TAGS UP PROPERLY
    //wp_set_post_tags($pid, $_POST[‘post_tags’]);

    //REDIRECT TO THE NEW POST ON SAVE
    //$link = get_permalink( $pid );
    $link =”http://saywhat.reviews/Reputation/thank-you/&#8221;;
    wp_redirect( $link );

    //POST THE POST YO
    do_action(‘wp_insert_post’, ‘wp_insert_post’);
    }
    //} // END THE IF STATEMENT THAT STARTED THE WHOLE FORM
    ?>

    <div class=”custom-form”>

    <form id=”new_post1″ name=”new_post1″ method=”post” action=”” class=”forms forms-inline” enctype=”multipart/form-data”>

    <label>Full Name: *</label>

    <input type=”text” id=”title” value=”<?php if(isset($title)){echo $title; }?>” tabindex=”5″ name=”title”/>
    <?php if($title_error != ”) { ?>
    <span class=”error”><?php $title_error;?></span>
    <?php } ?>

    <label for=”cemail”>Email Address: * </label>
    <?php if($cemail_error != ”) { ?>
    <span class=”error”><?php $cemail_error;?></span>
    <?php } ?>
    <input type=”text” id=”cemail” value=”<?php if(isset($cemail)){echo $cemail; }?>” tabindex=”5″ name=”cemail” />

    <label for=”phone”>Phone Number </label>
    <?php if($phone_error != ”) { ?>
    <span class=”error”><?php $phone_error;?></span>
    <?php } ?>
    <input type=”text” id=”phone” value=”<?php if(isset($phone)){echo $phone; }?>” tabindex=”5″ name=”phone” />

    <label for=”content”>Message</label>
    <?php if($content_error != ”) { ?>
    <span class=”error”><?php $content_error;?></span>
    <?php } ?>
    <textarea rows=”10″ cols=”70″ id=”content” value=”<?php if(isset($content)){echo $content; }?>”name=”content” /></textarea>

    <?php
    $bemail = get_post_meta( get_the_ID(), ‘bemail’, true );
    echo ‘<input type=”hidden” name=”bemail” id=”‘.$bemail.'” value=”‘.$bemail.'”;>’;
    ?>

    <?php
    $terms = get_the_terms( get_the_ID(), ‘business_name’ );
    if ( $terms && ! is_wp_error( $terms ) ) :
    $business_name = array();
    foreach ( $terms as $term ) {
    $business_name[] = $term->name;
    }
    $business_name = join( “, “, $business_name );

    echo ‘<input type=”hidden” name=”terms[]” id=”‘.$business_name.'” value=”‘.$business_name.'”;>’;
    endif; ?>

    <input type=”submit” value=”Submit” tabindex=”40″ id=”submit” name=”submit” class=”btn” />

    </fieldset>

    <input type=”hidden” name=”action” value=”new_post” />
    <?php wp_nonce_field( ‘new_post’ ); ?>
    </form>
    </div> <!– custom-form –>

    <?php }
    add_shortcode(‘bad_review_form’, ‘bad_review_form’);
    ?>

    • This reply was modified 7 years, 8 months ago by Geoffdoyle.
    #669641

    Hi,

    Change your shortcodes to this format:

    function custom_shortcode_func() {
    	ob_start();
    	?>
    		PUT YOUR CODE HERE
    	<?php
    
    	$output = ob_get_clean();
        return $output;
    }
    add_shortcode('my_shortcode', 'custom_shortcode_func');

    Shortcodes should return stuff, not echo directly into the page.

    You’re missing this at the end:

       $output = ob_get_clean();
        return $output;
    

    Best regards,
    Josue

    • This reply was modified 7 years, 8 months ago by Josue.
    #669659

    Hi Josue

    The code didn’t fix the said issue.

    The issue is, on our layout builder the form shortcode is at the bottom section. On front-end it is on top.

    The shortcode is not using any CSS or DIVs, but it is showing in the bottom. Please help

    on this page http://saywhat.reviews/Reputation/wp-admin/post.php?post=15&action=edit

    the shortcode form is at the bottom

    this one shows on top http://saywhat.reviews/Reputation/abc-company/

    #669877

    Hi,

    Please refer to:
    https://codex.wordpress.org/Shortcode_API#Output

    Best regards,
    Josue

    #670576

    Hi,

    I just wanted to know how we can take advantage of the taxonomy.php in enfold.

    We have a CPT good,bad and taxonomy of business_name, each business_name has its
    own term (ABC Company) and has several metabox fields attached to it.

    Question:
    How can we show these metabox data per business_name term? On the front-end
    Which file to edit and what is the exact hook we need?

    #671638

    Hi,

    Check the following:
    http://wpexplorer-themes.com/total/snippets/meta-shortcode/

    Best regards,
    Josue

    #671774

    Hi,

    Thanks for that, but we are not planning to use shortcode.

    We are planning to use taxonomy.php to display the variables (email, phone, business email)

    On this screenshot, those are the variables we wanted to display

    http://i63.tinypic.com/14kwk5h.jpg

    on this page http://i68.tinypic.com/33o77t5.jpg

    Can you please let us know if we can use taxonomy.php and which section can we add those variables?

    Appreciate it!

    #671834

    You don’t need to edit tag.php or archive.php for that, there’s a filter that lets you hook into the excerpt and modify it:

    add_filter('avf_post_slider_entry_excerpt', function( $excerpt, $prepare_excerpt, $permalink, $entry ) {
    
    	return "your code here";
    }, 10, 4);

    Also you have $entry available so you can get the ID of the Post ($entry->ID) and show the proper post_meta.

    Best regards,
    Josue

    #687192

    Hey Guys

    Different issue with Enfold.
    I use the advanced layout builder for my blog post but how can i get the comments to appear on the page.

    Thanks
    GD

    #688079

    Hi,

    Have you tried using the ALB Comments element?

    Best regards,
    Josue

    #688230

    Hi Josue

    I have used the Comments element but it has never worked on posts when we use the ALB.

    #688262

    Hi,

    Check here. (hosted on WPengine)

    Best regards,
    Josue

    #688848

    Hi Josue

    Your response makes no sense.

    The age that you referred me to has a facebook plugin, for the comments, because I can not get the Enfold comments to work.

    My problem is that this is an old blog and it has lots of existing comments that do not show up, because I can not get the Enfold comments to show up when I use the ALB.
    GD

    #688876

    First of all disable that plugin. Then make sure that Posts have comments enabled (under Discussions) – http://screencast.com/t/TRvgijEQqu

    Check these two:
    http://jostsauer.staging.wpengine.com/marijuana-or-meditation (hosted on WPengine) <small class=’av-host-link’>(hosted on WPengine)</small>
    http://jostsauer.staging.wpengine.com/become-a-drug-therapist-by-jost-sauer

    Best regards,
    Josue

    #691489

    Hi Josue

    I appreciate your comments but I am finding that even after following your directions I still can not get the comments to appear.

    Also I would like the related posts to appear as well but these seem not to work either.

    Your assistance would be appreciated.

    GD

    #691836

    Hey,

    I appreciate your comments but I am finding that even after following your directions I still can not get the comments to appear.

    Can you specify which Posts so i can check it in the backend?

    Also I would like the related posts to appear as well but these seem not to work either.

    Related posts will not appear on ALB-enabled Posts.

Viewing 26 posts - 1 through 26 (of 26 total)
  • You must be logged in to reply to this topic.