Load php file with jquery in single.php
Have a look at wp_localize_script(), which is exactly the right core function for your needs. A short explanation on the usage can be found in this answer to the question “Pass PHP variable to javascript”.
Have a look at wp_localize_script(), which is exactly the right core function for your needs. A short explanation on the usage can be found in this answer to the question “Pass PHP variable to javascript”.
The first problem you didn’t even mention is: you are putting shortcodes into a theme. Shortcodes are pure plugin territory, because they are changing post content and must survive a theme switch. Once you fixed that and moved the shortcodes to a plugin named inferno_shortcodes, the rest is easy: In your plugin ask for theme … Read more
But for some reason my posts get overridden instead of displaying new data. The problem is here: $announcements->query(‘showposts=1&cat=$category_id’); You are trying to use a variable inside a single quote string. Variables do not expand inside single quotes so instead of asking for cat=1, or cat=2, you are literally asking for cat=$category_id— just like that, spelled … Read more
Ask the option page_for_posts: get_permalink( get_option( ‘page_for_posts’ ) );
Here’s what we’ve come up with so far, and there’s definitely room for improvement. remove_action( ‘genesis_loop’, ‘genesis_do_loop’ ); add_action( ‘genesis_loop’, ‘ahso_custom_taxonomy_archive_loop’ ); function ahso_custom_taxonomy_archive_loop() { global $wp_query; // globalize it. // get category ID $cat_id = $wp_query->get_queried_object_id(); // get current category // get all child categories $cat_args = array( ‘type’ => ‘products’, ‘child_of’ => $cat_id, … Read more
You can simply use the featured image. Just output it where you want it to appear <?php the_post_thumbnail( $size, $attr ); ?> Use accordingly a class or a ID to style it with CSS. Take a look there: https://codex.wordpress.org/Post_Thumbnails to abilitate the featured image in your theme.
Firstly, don’t forget to always flush your rewrite rules by going to Settings -> Permalinks and just clicking on Save Changes Now on your problem, it seems that you’re missing an ‘&‘ in your query: $new_rules[‘^test-directory/(.*)/(.*)’] = ‘index.php?test-directory=$matches[1]&test-code=$matches[2]’; Notice the & after $matches[1] On the other hand, your ‘template_redirect’ action is not calling the correct … Read more
You can place another loop on the template, for example below the first loop. Multiple loops documentation: http://codex.wordpress.org/The_Loop#Multiple_Loops_Example_1 <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <!– your first loop … –> <?php endwhile; ?> <?php endif; ?> <?php wp_reset_query(); $tips_query = new WP_Query( ‘category_name=tips&posts_per_page=1’ ); ?> <?php if ($tips_query->have_posts()) : ?> … Read more
Since the myEventOn is a propitiatory plugin its difficult to provide a specific solution. However since your only have an issue on one page your best bet might be to use the Plugin Organizer plugin, which allows you to disable plugins by post type or by URL.
look in page-templates (folder) front-page.php EDIT: you can find page content in theme directory content-page.php