Noel Forte
Forum Replies Created
-
Forum: Plugins
In reply to: [Simple Ads Manager] If ad place has ad…I’m trying to figure out how to conditionally show and hide ad places in PHP. For example, if an ads place has no ads then I don’t want it to display.
Also, is there any way to get the image URL of an ad, for page background ads?
Forum: Hacks
In reply to: Working with TransientsThanks for the reply!
wp_flush_cache();
was what did it. By deleting the transient and flushing, I was able to get the transient to regenerate.Forum: Hacks
In reply to: Working with TransientsHey,
I’ve done some more digging, and discovered what the finer details of the issue I’m having are.
I have the transient set up so that when a user updates their own profile, or the profile of another user, the transient gets deleted. However, even with the transient non-existent in the database, WordPress continues on its way, loading the data as if nothing had happened, although the transient is in reality, gone.
Why is this happening?
Forum: Installing WordPress
In reply to: 2 databases or 1?Hi Chris –
Opening a second database may prove to be more secure if you are installing a completely new copy of WordPress for your new site. If for instance, you were running a multisite install, WordPress would use 1 database, as the sites would be running off of one copy of WordPress using 1 database login.
Because you’re running a completely new copy of WordPress, open a second database. Then if one database were to ever be hacked or compromised, the attacker would be quarantined to a single database, buying you time to secure your sites.
Just out of curiosity, why are you installing a new copy of WordPress to redesign your site? It’s usually better to install WordPress locally on your machine and develop there, pushing your new theme live when you are done. I would highly suggest you do this, unless you want to develop live. Read more about that here: https://codex.www.ads-software.com/WordPress_Installation_Techniques#Installing_WordPress_Locally
Best of luck,
Noel
Forum: Localhost Installs
In reply to: VPS Setup with File PermissionsI headed up the Stack Exchange community to get some input on the matter. They were extremely helpful and were able to answer all my questions. Resolving this issue is all based on what hosting you have, and if you manage you own box, what sort of software you wish to run on your machine.
I’ll include the links to my conversations on stack exchange.
WordPress Exchange: WordPress Answers – Running WordPress as the FTP user?
UNIX & Linux Exchange: UNIX & Linux – Apache ownership and permissions for WordPress
Forum: Installing WordPress
In reply to: cannot post anythingYou can add a new post by hovering over “Posts” in the sidebar and clicking “Add New”
or
You can click the “Posts” section in the sidebar to see all of your posts, and then click “Add New” at the top of the page.However, if either of those things isn’t there at all, try checking to see if there’s a users section in the left hand sidebar. If there is, click on “Users”, then on your account. Scroll down and make sure that “Role” is set to “Editor” or “Administrator”
Hope this helps.
Hi rucontent,
If you’re looking just to publish content, check out WordPress.com, where you can set up a free blog, and even tie it to your own domain name if you wish.
This site is for www.ads-software.com users, where you can download the WordPress source code and install it on a server to use with your own personal website. It’s not an application.
Hope this helps,
Noel
Forum: Fixing WordPress
In reply to: Delete Caption ShortcodesThanks for the tip, however,relying on a plugin that just hides the shortcodes doesn’t really do what I need either. It still preserves the shortcodes in the database and in the post content, meaning that the site would need to be dependent on the plugin to operate properly. I would prefer to not have to install yet another plugin that serves no purpose other than hiding shortcodes.
Forum: Fixing WordPress
In reply to: Issues with pagination on front page?The issue fixes itself if I go to Settings > Reading > and set “Front page displays” Use “Static Front Page”.
Is it possible to use
front-page.php
with Settings > Reading > “Front page displays” set to “Your latest posts”?If I set that, what ends up happening is the 4th page (
domain.com/page/4
) returns a WordPress 404. Why is this happening?Forum: Fixing WordPress
In reply to: Alternative to wp_die() on comment forms?Hm, that is funny, considering that if I’m running a local version of WordPress I usually just end up putting in a bogus email to create a user account. Email validation can be tricky.
As far as comment submission goes, is there any way to submit a comment without refreshing the page?
Just curious.
Forum: Fixing WordPress
In reply to: Add a class on an li for "current category"UPDATE: I was able to figure this out, thanks to some conditional tags.
Forum: Fixing WordPress
In reply to: Search query and results count not showing in search resultsI was able to figure this out by using a good old little trick in the PHP manual. I did a google search to see if there was any way of echoing out form data that was submitted. It turns out that PHP has that functionality built right in.
https://php.net/manual/en/reserved.variables.get.php
The variable
$_GET
automatically returns the term that is being called for in a defined query. So, if I wanted to echo out my current results, I might create a page title for my page template that looks something like this:<h1 class="page-title"><?php echo( 'Search Results for: "'); ?><span><?php echo $_GET['q']; ?></span>"</h1>
In the example above, we utilized
echo $_GET['q'];
in our php code, which echoed out the term being currently used by our “q” query term. Notice that to use the quotation marks, I used my double quote in the firstecho ('Search Results for: "');
, and then closed our quotation marks right before closing the h1 tag.Hope this helps. You can see a live demo of this technique in action on my own search results page here.
Forum: Plugins
In reply to: Google Custom Search Query StringI was actually able to resolve this problem, and never closed this thread. I’ll post the solution on the thread posted by Herbie Hysteria above. Thanks! ??
Forum: Networking WordPress
In reply to: Multisite Search?Hi jnwb,
Here’s the fix: (and an explanation)
In this case, the solution is actually in the error message. If we open up our file “class.widgets.php” which you can find by going toi the path dictated in the warning, we see the following on lines 109-137.
function ms_global_search_vertical_form( $page, $search_pages, $hide_options ) { if( isset( $this ) ) { $id_base = $this->id_base; } else { $id_base = 'ms-global-search'; } $rand = rand(); $rand2 = $rand + 1; ?> <form class="ms-global-search_form" method="get" action="<?php echo get_bloginfo( 'wpurl' ).'/'.$page.'/'; ?>"> <input id="s" class="field" name="mssearch" type="text" placeholder="Search across network sites:" size="16" tabindex="1" /> <input type="submit" id="searchsubmit" class="button submit" value="<?php _e( 'Search', 'ms-global-search' )?>" tabindex="2" /> </form> <?php } function ms_global_search_horizontal_form( $page, $search_pages, $hide_options ) { if( isset( $this ) ) { $id_base = $this->id_base; } else { $id_base = 'ms-global-search'; } $rand = rand(); ?> <form class="ms-global-search_form" method="get" action="<?php echo get_bloginfo( 'wpurl' ).'/'.$page.'/'; ?>"> <input id="s" class="field" name="mssearch" type="text" placeholder="Search across network sites:" size="16" tabindex="1" /> <input type="submit" id="searchsubmit" class="button submit" value="<?php _e( 'Search', 'ms-global-search' )?>" tabindex="2" /> </form> <?php }
The above code might look a bit different than your own; I hacked the plugin and inserted the WordPress search form as the return for the search form instead of the multisite one, this way it styles the same in your CSS as it was intended in your theme.
These two functions are what control the php code that you called. (
<?php Multisite_Global_Search::ms_global_search_horizontal_form('search-results') ?>
However, when you compare your php to the function that the php is calling, you might notice something odd.Remember, this is what you put in:
<?php Multisite_Global_Search::ms_global_search_horizontal_form('search-results') ?>
and the function looks like this:
function ms_global_search_vertical_form( $page, $search_pages, $hide_options )
So what we have here is a line of PHP code that calls a function which demands $page, $search_pages, and $hide_options as input arguments, but in our code, we only provided one, “search-results” as our $page, hence the “missing argument on line 109”.
So to fix this, let’s provide the function in the “class.widgets.php” file with two additional arguments, whether we want to search pages, and whether we want to show the options.
My final markup looked like this:
<?php Multisite_Global_Search::ms_global_search_vertical_form('search-results','','hide_options'); ?>
Notice I left the $search_pages option blank. You can do this, and the plugin will default to a value of 0, and not search pages. If you would like to include pages in your search, set it to 1.
Kinda a long way around just for one line of code, but I hope the explanation was useful. If you have more questions, don’t hesitate to ask.
PS. I didn’t like how this plugin worked, there were a few quirks to get by. If you dig through the plugin files, you could figure out what everything does and hack it to your liking. After all that’s the purpose of plugins, right? Open source for the win.
Hope this helped,
Noel
Forum: Themes and Templates
In reply to: Custom Post Types: Where is my ".entry-meta"?Was able to fix simply by
using the_terms()
orget_the_term_list()
. Those articles can be found at: https://codex.www.ads-software.com/Function_Reference/the_terms, and https://codex.www.ads-software.com/Function_Reference/get_the_term_list