Darrell Schauss
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to remove posted date and by…redi1 deleting all of the function will cause the function to not exist thus undefined everytime the function is called.
either delete everything insidefunction twentyten_posted_on() {
}
(but you lose it in case you need it) or just comment out<?php //twentyten_posted_on(); ?>
where you dont want to use it.Forum: Plugins
In reply to: [Plugin: WP MU Domain Mapping] can't map domains after setupOk I figured that out too. “Primary” is to specify that the domain being mapped is the primary out of the two between the site’s subdomain in MU and the one being mapped. So that the mapped domain is loaded instead when accessing site1.domain.com
Forum: Fixing WordPress
In reply to: requested url too largeIt probably not related but I do see a missing closing
>
on the body
<body class="wordpress k2 y2010 m08 d13 h10 home sidebar-dual"
Forum: Requests and Feedback
In reply to: Feature RequestCurrently, color schemes for links, text, divs, etc. CSS can be applied to the body class if you have
<?php body_class( $class ); ?>
in the<body>
tag.By default the category class is not applied when viewing a post. If you need to have the color scheme on posts within the category as well (most likely), at the bottom is an example how to do that.
Forum: Fixing WordPress
In reply to: Access to second database from php include breaks WP queries after.Are you including a config file with
define('DB_NAME', ''); define('DB_USER', '');
..etc? This will overwrite your base WordPress installs wp-config.php settings when you load up your own.
You could do like this.
define('DB2_NAME', ''); define('DB2_USER', '');
etc..
And you can connect to another database
$databasetwo = mysql_connect('DB2_HOST','DB2_USER','DB2_PASSWORD'); mysql_select_db('DB2_NAME',$databasetwo); $results = mysql_query("SELECT...",$databasetwo); //do stuff... mysql_close($databasetwo);
I am doing this in the middle of my index.php without having to do anything with the current WordPress connection.
Forum: Fixing WordPress
In reply to: Trying to get back the url for form actionThere are so many ways to sanitize a URL depending on purpose I finally come across the WordPress built in way. At least do this.
<form method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
Probably the safest way. Get it directly from WordPress.
<form method="post" action="<?php echo esc_url(get_permalink()); ?>">
Forum: Fixing WordPress
In reply to: Trying to get back the url for form actionDid you try the REQUEST_URI? Perhaps I should have given example. It worked for me.
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
I just did some playing around.
Template Name: URL Test
Template file: url_test.php
Page created: “Test the URL” (with: /test-the-url/ as permalink)Here is what each gives. Although using it alone is not safe from hack attempts.
$_SERVER[‘REQUEST_URI’]; returns: /test-the-url/
$_SERVER[‘PHP_SELF’]; returns: /index.php
basename(__FILE__); returns: url_test.phpForum: Fixing WordPress
In reply to: Trying to get back the url for form actionYou want the form to submit to the page itself that the form is on and the form may be on any page?
Is it actually returning this in your view source?
<form method="post" action="https://url.com/form/form">
Or is it returning this causing it to be a relevant link, thus double /form/form?
<form method="post" action="form">
If its just returning “form” then
<form method="post" action="/<?php echo basename(__FILE__) ?>">
Though if you don’t always expect the path to start from root you can try $_SERVER[‘REQUEST_URI’];
Forum: Fixing WordPress
In reply to: WordPress as a CMSWhat I’ve done is have a template that loads the page content but below also has another “sidebar” section. But with full horizontal width allowed into the page instead of your typical widget in a column. Then using Spectacu.la Page Widget to assign a full WYSIWYG page as content into a widget. Spectacu.la will give a checkbox to exclude this special page from wp_list_pages, etc.
Then I used Widget Logic or Widget Context plugin to tell it to only load that Spectacu.la widget on a certain page.https://www.ads-software.com/extend/plugins/spectacula-page-widget/
https://www.ads-software.com/extend/plugins/widget-logic/How to register more sidebar sections and call them into areas of your theme.
https://codex.www.ads-software.com/Function_Reference/register_sidebar
https://codex.www.ads-software.com/Function_Reference/dynamic_sidebarHere is an example:
https://www.obryanbarrel.com/
The blue barrel section is actually a “sidebar” loading a real page so any images and text can be applied. Or choose to show nothing by removing the widget, without having to delete all your contents. The page contents are always in the red area.
The green bar across the bottom is actually also a sidebar loading a real page with tables and graphics. It can be whatever information the WYSIWYG allows.Forum: Fixing WordPress
In reply to: Can't delete original permalink page – disrupting URLsI fixed this before. I believe I had to go into database and delete all the past revisions for that page. Though I think in my case I didn’t delete the page. I changed the permalink and was trying to apply the former slug it to another page. It may be the same fix.
DELETE FROM wp_posts WHERE post_type ='revision' AND post_id = 1;
whatever is the post_id.Did you accidentally delete it from the Trash too already? If it is still in your trash you can recover it and start using the old page again.
Forum: Fixing WordPress
In reply to: Error embedding google mapsedit: let me check this out again. i finally able to reproduce the issue.
It definitely has to be fault of google maps as I created a long page with nothing but the google map embed and it jumped on me in IE8.
Forum: Fixing WordPress
In reply to: [Plugin: Google XML Sitemaps] How to Disallow sub-directory?/directory/ doesnt mean anything. Just a placeholder as example.
Forum: Fixing WordPress
In reply to: How to use wordpress-fix.php from SSH?Try without the $ at front. $ or # at front usually indicants the start of the command not something you actually type.
find ./ -name "*.php" -type f | \ xargs sed -i 's###g' 2>&1$ find ./ -name "*.php" -type f | \ xargs sed -i '/./,$!d' 2>&1
This should show you results and not actually change files. Not tested but I do command like this with grep a lot.
find ./ -name "*.php" -type f | \ xargs grep -i 's###g' 2>&1$ find ./ -name "*.php" -type f | \ xargs grep -i '/./,$!d' 2>&1
Forum: Fixing WordPress
In reply to: Link to information sourceThen click the link icon to insert a link and choose Open in new window. If a link already exist in a post you can just click the cursor onto it in the editor then click the link icon to edit it to Open in new window.
Forum: Fixing WordPress
In reply to: Show authors in sidebar with info and pictureJust to be sure…
It may be confusing, but if you have any code knowledge hopefully you figured it out.Example:
this:
<?php if( $user->aim != ”){ ?>
should be two single quotes. representing blank string.
<?php if( $user->aim != ''){ ?>
and not a double quote even though they all look like doubles.
not this:<?php if( $user->aim != "){ ?>
These are doubles:
<li><a href=”<?PHP echo $user->jabber ?>”>Blog</a></li>
as
<li><a href="<?PHP echo $user->jabber ?>">Blog</a></li>