Give wp link pages it’s own template

In your single.php add this example code inside the loop: <?php global $page; if ($page == 1) {?> <div style=”color:red;”>This text should only appear on first page of the post!!!</div> <?php } ?> you can change the div with your thing that you wanted to display only on the first post page..

Query the database after get_header() has been included

Your question is vague: i’ll try to be as specific as possible. The basic rule is: if you need to modify the default query, use pre_get_post If you need to display another list of results than the one linked to your template url, use get_posts. I find this documentation to be quite useful http://developer.wordpress.com/2012/05/14/querying-posts-without-query_posts/ Doc … Read more

Modify just ONE page based on a template

You should create a new page template based on your current page template. Without any example code it is hard to give you a specific example, but here’s an approach: Copy page.php to a new file and name it page-wide.php. The prefix page- is significant because it triggers WordPress’ template hierarchy. At the top of … Read more

php loading different structure than source code

You’re using template tags within an echo statement that themselves echo a value. You need to use the versions that return their value. the_permalink() should be get_permalink, the_post_thumbnail should be get_the_post_thumbnail, the_title should be the_title( ”, ”, false ), the_content should be get_the_content().

add jquery file if a certain page is included

While you can approach it with “what template is loaded”, WP isn’t engineered for such logic. Template load is result of logic processing, not the other way around. You should check out Conditional Tags and determine which logical check applies to your situation. Other than that you should be: running script-related logic on appropriate wp_enqueue_scripts … Read more

Force WordPress to load a specific template

Depending on your home page, you either can set up a template file home.php (archive) or front-page.php (static page). In the according file, you can do whatever you want. Run additional queries, load content from whatever source etc. If this is not what you want, then you can have a look at the template_include filter … Read more

List all native posts in template page?

There is nothing wrong in your query, but there is some code (a plugin?) that remove from results the posts in the category having term id 1 or 4. (Normally category with term id 1 is ‘uncategorized’) You can notice that looking at request performed AND ( wp_posts.ID NOT IN ( SELECT object_id FROM wp_term_relationships … Read more

Ajax Call in page theme not working?

You shouldn’t be including jQuery explicitly. WP ships with a copy and multiple copies tend to mess things up. See wp_enqueue_script(). You shouldn’t be trying to load PHP file inside a theme directly. It won’t load WordPress environment that way (unless it tries to do so explicitly, which is usually very fragile and pretty much … Read more

Apply nextgen-gallery lightbox effect [closed]

I’m not familiar with exactly how nextgen-gallery does it, but typically for lightbox effects you need to add rel=”lightbox” to the image tag for it to work. To do that you’d do something like this: $attr = array( ‘rel’ => “lightbox”, true) )), ); echo wp_get_attachment_image( get_post_meta( get_the_ID(), ‘afp_analysis_chart’ , true), ‘large’, 0, $attr );