Jim R
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: I need to GET the ID of a Tag, so I can use it…Since I see your name dotted around the forum providing good solutions, any idea why the code above would make widgets disappear from the sidebar? It has something to do with the select_mysql_db command. I even tried closing the connection, but that didn’t work either…unless I’m not closing it properly.
Forum: Fixing WordPress
In reply to: Widgets not showing up in sidebarsI’m having the same problem. With me it has something to do with my database select code, which is the second line of code in the following:
<?php $wp_tagID = get_query_var('tag_id'); mysql_select_db("jwrbloom_hhr"); $query = 'SELECT * FROM playerRank'; $results = mysql_query($query); while($line = mysql_fetch_assoc($results)) { if ($line['wpID'] == $wp_tagID) { echo '<div class="player">'; echo '<div>' . $line['nameFirst'] . ' ' . $line['nameLast'] . '</div>'; echo '<div><strong>' . $line['height'] . ' '; if ($line['position'] == 'PG') {echo 'Point Guard';} elseif ($line['position'] == 'SG') {echo 'Shooting Guard';} elseif ($line['position'] == 'SF') {echo 'Small Forward';} elseif ($line['position'] == 'PF') {echo 'Power Forward';} elseif ($line['position'] == 'C') {echo 'Center';} echo '</strong></div>'; echo '<div><strong>' . $line['hschool'] . '</strong></div>'; echo '<div><img src="/wp-content/uploads/' . $line['nameLast'] . $line['nameFirst'] . '.jpg" width=150 height=200></div> </div>'; } } ?>
Forum: Fixing WordPress
In reply to: Widgets disappearingI’m having problems with disappearing Widgets too. It started while I was using the PHP Code Wdiget plugin, but I’m not sure it has much to do with that Widget. I’m pretty sure it has more to do with what is in the custom PHP code.
Example…here is a code I’m using to carry profile information to Tag Archive pages:
<?php $wp_tagID = get_query_var('tag_id'); mysql_select_db("jwrbloom_hhr"); $query = 'SELECT * FROM playerRank'; $results = mysql_query($query); while($line = mysql_fetch_assoc($results)) { if ($line['wpID'] == $wp_tagID) { echo '<div class="player">'; echo '<div>' . $line['nameFirst'] . ' ' . $line['nameLast'] . '</div>'; echo '<div><strong>' . $line['height'] . ' '; if ($line['position'] == 'PG') {echo 'Point Guard';} elseif ($line['position'] == 'SG') {echo 'Shooting Guard';} elseif ($line['position'] == 'SF') {echo 'Small Forward';} elseif ($line['position'] == 'PF') {echo 'Power Forward';} elseif ($line['position'] == 'C') {echo 'Center';} echo '</strong></div>'; echo '<div><strong>' . $line['hschool'] . '</strong></div>'; echo '<div><img src="/wp-content/uploads/' . $line['nameLast'] . $line['nameFirst'] . '.jpg" width=150 height=200></div> </div>'; } } ?>
The line that causes all of my widgets to disappear is the second line of my PHP code:
mysql_select_db(“jwrbloom_hhr”);
I’ve tried a couple of other options, but then my code doesn’t work.
Forum: Themes and Templates
In reply to: Sidebar widgets to Disappear?Use the plugin Widget Logic. It’s the most flexible because it provides a blank in each Widget where you can put a conditional tag. Anyone from determining if a User is logged in to what Post, Page or Category you’re viewing.
Another one to try, which isn’t as flexible but a little easier to use is Widget Context. That gives you check boxes for types of Pages, and it allows you to put specific Pages and Posts where you can either only show the widget or only hide it.
Forum: Fixing WordPress
In reply to: I need to GET the ID of a Tag, so I can use it…Figured it out. I didn’t have the double == in my “IF” statement, and I hadn’t close my while or if loops.
<?php
$wp_tagID = get_query_var(‘tag_id’);mysql_select_db(“jwrbloom_hhr”);
$query = ‘SELECT * FROM playerRank’;
$results = mysql_query($query);
while($line = mysql_fetch_assoc($results)) {if ($line[‘wpID’] == $wp_tagID) {
echo ‘<div>’ . $line[‘nameFirst’] . ‘ ‘ . $line[‘nameLast’] . ‘</div>’;
}}
?>Forum: Fixing WordPress
In reply to: I need to GET the ID of a Tag, so I can use it…BTW…the result in the PHP widget block is basically nothing, just blank.
Forum: Fixing WordPress
In reply to: I need to GET the ID of a Tag, so I can use it…Take a look at this. When I echo out $wp_tagID, which is defined in the first line of the PHP code, it outputs the correct value. There is a corresponding ID in my playerRank table, and it should be echo’ing information from the one that matches.
I’m putting this code in a PHP widget block.
<?php $wp_tagID = get_query_var('tag_id'); mysql_select_db("jwrbloom_hhr"); $query = 'SELECT * FROM playerRank'; $results = mysql_query($query); while($line = mysql_fetch_assoc($results)) { if ($line['wpID'] = $wp_tagID) { echo '<div>' . $line['nameFirst'] . ' ' . $line['nameLast'] . '</div>'; ?>
Forum: Fixing WordPress
In reply to: I need to GET the ID of a Tag, so I can use it…The second one isn’t working, and I’m guessing that’s the one I need since I need to do more than echo it. I’m using it in a PHP block widget, and it makes my other code not work. It’s just:
echo 'Just testing...';
The $wp-query makes it disappear.
Regarding the first option, would I assign a string variable to that result so I could use it later?
$ID = get_query_var(‘tag_id’);
Still, very helpful. I feel like I’m getting closer, and once I can carry that value over, the rest, for me at least, is easy.
Forum: Fixing WordPress
In reply to: I need to GET the ID of a Tag, so I can use it…Dang it, I knew my request was too simple, trying to avoid a double post. I need to get the Tag ID passed through after clicking on the Tag’s link. So I click on siteURL.com/tag/tag1_tag2, and it takes me to an Archive.php. I need to get the ID of that Tag so I can use it for something else to put on that Archive.php along with the other content.
Forum: Fixing WordPress
In reply to: Linking profile or database information to Post Tags…I want to take the $tag_id and associate it with information in another table. Keep in mind, at this stage, I’m manually copying the $tag_id from my WordPress table to my custom table. Again, in my custom table, it’s about a player (his name, school, grade, height, etc), while my Tags in WP are player names, school names, class (2010, 2011, etc) and other keywords. That means not all my $tag_id are useful to me in my custom table.
So let’s go back to the User clicking on a Tag link. It passes the User to the Archive.php page template with the URL of https://www.hoosierhoopsreport.com/tags/firstWord_secondWord. The actual ID isn’t passed via the URL. Is it still there for me to use?
Forum: Plugins
In reply to: [Plugin: User Community] community page is blankWhere does one go to see settings? I’ve installed Alkiva, and I have no Admin options to make changes.
Forum: Installing WordPress
In reply to: Having a problem with a clean install I have not faced before…Yeah…I figured it out around 3am.
Forum: Installing WordPress
In reply to: Having a problem with a clean install I have not faced before…BTW…the URL it’s at now is hoosierhoopsreport.com. Long story, but that is my root directory.
Forum: Installing WordPress
In reply to: Having a problem with a clean install I have not faced before…That error is gone. Now I’m trying to reinstall over an existing database. The homepage is just blank. I tried installing over a fresh database, then copying the old database into it. Same result.
Forum: Installing WordPress
In reply to: Having a problem with a clean install I have not faced before…My ISP can’t even get this thing to install properly.
What is going on????