Nick
Forum Replies Created
-
Forum: Themes and Templates
In reply to: converting from query_postsThanks for the pointers.
How do I get an array out of the loop using WP_Query?
Take this from the WordPress functions page, how do I put get_the_title() into an array, amongst other things?
$the_query = new WP_Query( $args ); // The Loop while ( $the_query->have_posts() ) { $the_query->the_post(); echo '<li>' . get_the_title() . '</li>'; }
With this, I get Undefined variable title on line…
$the_query = new WP_Query( $args ); // The Loop while ( $the_query->have_posts() ) { $the_query->the_post(); $title[] = get_the_title(); }
I just echo $title[0] or $title[1] for example.
Forum: Themes and Templates
In reply to: converting from query_postsFrom WordPress codex:
https://codex.www.ads-software.com/Function_Reference/query_posts
Note: This function isn’t meant to be used by plugins or themes. As explained later, there are better, more performant options to alter the main query. Double Note: query_posts() is overly simplistic and problematic way to modify main query of a page by replacing it with new instance of the query.
Forum: Plugins
In reply to: [GC Testimonials] Blank home page when plugin is activatedOk thanks. Will look into them and get the code updated ??
Forum: Plugins
In reply to: [GC Testimonials] Blank home page when plugin is activatedOk thanks. You reckon this might be causing the issue?
What do you suggest to use instead?
Forum: Plugins
In reply to: [GC Testimonials] Blank home page when plugin is activatedBlank pages upon plugin activation.
Have pasted the first part of the home page here: https://pastebin.com/UqmdyYmS
The plugin settings will be on default, no shortcode or widgets will be used with this plugin as it causes the break on activation.
Not had any problems like this with any other plugins.
Forum: Plugins
In reply to: [GC Testimonials] Blank home page when plugin is activatedRun the phpinfo(); but cant see any differences between the 2 – is there anything specific to look for that might affect this?
As for the blank page after the header, yeah how you described it.
The browser renders everything up until the end of header.php
After that, nothing is displayed – in either the browser or the source code. Just stops at the last tag in the header.php which is <div id=”main”>, the opening tag for the main content.Forum: Plugins
In reply to: [GC Testimonials] Blank home page when plugin is activatedThanks.
To confuse matters some more. I get a few errors with the WP_DEBUG on true, but only one that’s associated with this plugin. However, that only appears on the admin panel and not the front end:
Notice: Use of undefined constant KCVT_URL – assumed ‘KCVT_URL’ in /……./wp-content/plugins/gc-testimonials/testimonials.php on line 946
Forum: Plugins
In reply to: [GC Testimonials] Blank home page when plugin is activatedReplicated the site to a test server to help solve the problem, like de-activating and re-activate other plugins one by one, default theme etc…and i cant replicate the problem, but yet it exists on the live site…which is really annoying as it doesn’t help in trying to find a potential problem.
Any ideas are welcome!
Forum: Plugins
In reply to: [Uji Popup] "One time per user."Would also like to know how to activate this. The popup always shows on every page. If its a premium only thing, then that’s pretty poor to be honest – its vital to be able to give the user control over this, be it a free or paid plugin.
Could you create it so it only shows once per session?
Forum: Plugins
In reply to: [WP-Polls] Hidden results featureSeems to work ok by using the different template areas to display different bits rather than the default templates.
Thanks.
Forum: Fixing WordPress
In reply to: current-menu-item missing from menu itemsYeah, but I’m not sure how. I’m using WP’s menu functions, so in theory it should work right? Why would WP give, for example, the home page menu item the class ‘current-menu-item’ when I’m not on the home page, but a subpage displaying blog posts.
Similarly, why would it not give a menu item the ‘current-menu-item’ class when I am on that page?
Forum: Fixing WordPress
In reply to: current-menu-item missing from menu itemsTried it on a test server, and the 2012 theme seems to work ok with the menu highlights, just not my custom theme.
Forum: Fixing WordPress
In reply to: current-menu-item missing from menu itemsSome other strange problems:
Not just one page that has this, but 2.
Another thing, is when on a page that has a custom template to display news/blog posts, the home page menu is activated as the current page, when its not?
Forum: Fixing WordPress
In reply to: current-menu-item missing from menu itemsI’m always wary of doing that, as I always find a multitude of things disappear when I switch it back. Particularly widgets.