Add point on excerpt post

First of all return is used in PHP to return a value from a function. If you want to display something you need echo. Second, no excerpt is displayed in the lines you are pointing to. The excerpt is retrieved and then stored in a variable $myExcerpt. If you want to add … to the … Read more

How can I display a list of pages and the template used by each?

You could try this quick piece of code, it doesnt output to array though. $args = array( ‘meta_key’ => ‘_wp_page_template’, ‘sort_column’ => ‘post_title’, ‘sort_order’ => ‘desc’); $templates = get_pages($args); foreach ( $templates as $template){ $templatePage = $template->meta_value; $templateName = $template->post_name; echo “Named Template: {$templateName} – – {$templatePage}\n”; }

How can I make is_page_template() workable in child theme?

Your first version of no_sidebar_style() looks fine: function no_sidebar_style(){ if (is_page_template(‘page-templates/page-nosidebar.php’)) { wp_enqueue_style( ‘no-sidebar-style’, get_stylesheet_directory_uri().’/css/no-sidebar.css’); } } add_action( ‘wp_enqueue_scripts’, ‘no_sidebar_style’, 19); For debugging, you can use get_page_template() to see the name of the template you’re viewing.

Display grandchild page content on parent page

From your question I understand that inside the top level page you want to indicate which child page to include. The obvious way to do this is using a shortcode. So in your functions.php you would have something like this: add_shortcode( ‘insert_child’, ‘wpse240522_insert_child’ ); In the content of your top level page you would have … Read more

Getting a jQuery library to work in WordPress & Avada

Here’s a tweaked version of the original code. get_template_directory_uri() is used instead of hard coding the URLs, the scripts and styles are enqueud rather than just being registered, and the dependencies are specified. <?php function wptuts_scripts_load_cdn() { wp_enqueue_script( ‘multi-select’, get_template_directory_uri() . ‘/selector/js/jquery.multi-select.js’, array( ‘jquery’ ), null, false ); // JavaScript for theme. Presumably where you’d … Read more

Error while submitting form using AJAX and php

I believe it is because you are trying to set object properties that are undefined. Your javascript should look like this var measrumentData = { profile_name:null, value_one:null, value_two:null }; // Grab our post meta value measrumentData.profile_name = $( ‘#savem #profile_name’ ).val(); measrumentData.value_one = $(‘ #savem #value1’).val(); measrumentData.value_two = $(‘ #savem #value2’).val(); or var measrumentData = … Read more