pdxchambers
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Embedded Video Doesn’t DisplayDoh! WordPress troubleshooting 101… disable plugins… found the problem, something with the All-in-One Event Calendar by Time.ly plugin is interfering with oEmbed apparently. I disabled it and the problem was fixed.
Thanks for the help!
Forum: Developing with WordPress
In reply to: Embedded Video Doesn’t DisplayI’m using
the_content()in the custom loop. I tried upgrading the PHP on my hosting provider to 7.0 (from 5.6) but there wasn’t any change. It seems to me that if the issue was with the oEmbed hook it would be doing the same thing on the single post template, but that template is displaying the video as expected.Forum: Developing with WordPress
In reply to: Embedded Video Doesn’t DisplayIt’s a template that I’m developing. It’s just weird because it works on my development machine but not on the test server even though it’s the same code. I’m not seeing anything obvious in the console and it works everywhere else in WordPress (post editor, single post view, etc)
Forum: Developing with WordPress
In reply to: Logo Image not DisplayingWow… I totally didn’t see that! It’s working now, thank you so much!
Forum: Developing with WordPress
In reply to: Logo Image not DisplayingThis is the function I’m using to display the logo. When I remove the
classdefinition I get the same issue, however on inspecting the code it looks more in line with what it’s supposed to look like:<div class="col-xs-1" <img src="http://192.168.1.200/wordpress/wp-content/themes/coh2017/images/logo.png"></div>I can’t for the life of me see where there’s a problem, it seems like there should be no issue with having a
classattribute before thesrcattribute in the element. Here’s the actual function that’s generating the code:function coh2017_the_custom_logo(){ /* * Echos custom HTML elements to support Bootstrap classes. If a change is needed to the branding of the theme, * this is where you'll want to do it. */ $logo_id = get_theme_mod( 'custom_logo' ); $logo = wp_get_attachment_image_src( $logo_id , 'full' ); if (has_custom_logo() ) { echo '<div class="col-xs-1" <img class="img-responsive" src="' . esc_url( $logo[0] ) . '"></div>'; echo '<div class="col-xs-11"><h1 id="site-title"><a href="' . esc_url( home_url( '/' ) ) . '" rel="home">' . esc_attr( get_bloginfo( 'name' ) ) . '</a></h1>'; echo '<h2 id="site-description">' . esc_attr( get_bloginfo( 'description' ) ) . '</h2></div>'; } else { echo '<div class="col-xs-1" <img class="img-responsive" src="' . IMAGES_DIRECTORY . 'logo.png"></div>'; echo '<div class="col-xs-11"><h1 id="site-title"><a href="' . esc_url( home_url( '/' ) ) . '" rel="home">' . esc_attr( get_bloginfo( 'name' ) ) . '</a></h1>'; echo '<h2 id="site-description">' . esc_attr( get_bloginfo( 'description' ) ) . '</h2></div>'; } }I’m then calling
coh2017_the_custom_logo();inheader.php.EDIT: I should mention at this point it’s running the
elseclause as I haven’t actually added a custom logo in Theme Customizer yet.- This reply was modified 9 years, 2 months ago by pdxchambers.
Forum: Developing with WordPress
In reply to: Logo Image not DisplayingI published it to coh.pdxchambers.com. The logo should display immediately to the left of the site title. When I check computed styles I don’t see anything obvious that would stop the image from being displayed, in fact the containing element displays exactly as it should if there’s nothing in it with a
widthof 8.3% and amin-heightof 1 pixel. Maybe fresh eyes will see something I’m missing?Forum: Developing with WordPress
In reply to: Logo Image not DisplayingIF I inspect the code via dev tools, I can see the full URI of the image is getting output to the browser. If I follow it the image displays in the browser perfectly fine on its own. I’m working on a local dev environment so posting a link to it isn’t an option, however I do have a test server I can upload to (not sure why I didn’t think of this before) so I’ll give that a shot later and see if there’s a difference. At the very least it should tell me if the issue is a local one or not.
Forum: Hacks
In reply to: Two Questions: Custom DB Query not working properlyI just realized that the reason my results aren’t displaying is because I defined my
$tablevariable within theforeachstatement. It was doing exactly what it was supposed to be doing, I was just overwriting the variable with each iteration of the loop. That’s why only the last result was being displayed. I moved the variable declaration out of the loop and changed it to concatenate all the way through the loop and it worked perfectly.`
foreach ($rows as $row ) {
$table .= ‘<table>’; //<–changed this to concatenate instead of just assign.. works now!
$table .= ‘<tr><th>’ . $row[‘name’] . ‘</th><td>’ . $row[‘phone’] . ‘</td></tr>’;
$table .= ‘<tr><td>’ . $row[‘website’] . ‘</td><td>’ . $row[‘twitter’] . ‘</td><td>’ . $row[‘instagram’] . ‘</td><td>’ . $row[‘facebook’] . ‘</td></tr>’;
$table .= ‘<tr><td>’ . $row[‘address’] . ‘</td><td>’ . $row[‘city’] . ‘</td><td>’ . $row[‘state’] . ‘</td><td>’ . $row[‘zip’] . ‘</td></tr>’;
$table .= ‘<tr><td>’ . $row[‘notes’] . ‘</td></tr>’;
$table .= ‘</table> <p>Num_Rows = ‘ . $wpdb->num_rows;
}**facepalm**
Forum: Hacks
In reply to: Two Questions: Custom DB Query not working properlyI think I might have fixed the issue with
$wpdb->prepare()… I removed it from here…if ( $selector == 'all' ) { $sql = 'SELECT * FROM ' . $db_table; $rows = $wpdb->get_results( $sql, ARRAY_A ); }I did that because that query isn’t using anything user supplied… I then modified the
elseclause…else { $sql = $wpdb->prepare('SELECT * FROM ' . $db_table . ' WHERE city = %s', $selector); $rows = $wpdb->get_results( $sql, ARRAY_A ); }‘$selector’ is input from the user via a form so I felt that really needs to be escaped. This seems to be working, however I’m still getting only one result displayed instead of all of them as in my original post.
Forum: Themes and Templates
In reply to: Cannot modify header informationSo I think I figured it out. I removed the final
?>tag from the code and when that didn’t work I decided to clean up the code a bit by minimizing the number of<?php ?>blocks. I ended up removing one?> <?phpcombination at, you guessed it, line 236. That appears to have done the trick… all is well now.Forum: Themes and Templates
In reply to: Remove H1 tag from site-title, except on homepageyou could try:
if (is_front_page()){ echo '<h1 class="site-title">Site title</h1>';Or something like that… basically you’re testing that the page is the front-page and if it is displaying the H1 and H2 tag otherwise display whatever else you want if it isn’t.
Forum: Themes and Templates
In reply to: add background to content in Single Post/PageIf I’m understanding correctly based on the example you posted, the problem is the page background underneath the post… as I see it there are two options… one would be to eliminate the background image, the other would be to modify the transparency on the post background so the page background doesn’t show through as much. In either case if you only want the change to impact single posts you would need to modify the single post template (single.php) and add styling to override the main styling. I’m sorry to say I’m not familiar with the plugin mentioned in Andrew’s post above so I can’t speak as to how to do it with that plugin.
Forum: Themes and Templates
In reply to: add background to content in Single Post/PageThis could be done simply in CSS… just add the
background-imageproperty to the class of your single post container. For example if your posts are wrapped in<div class="single-post">then you’d do something like this in your CSS:.single-post { background-image: url("path to image"); }Forum: Themes and Templates
In reply to: Twenty Twelve Child Theme "Stylesheet is missing" MessageIf you used Notepad it is possible it added .txt to the end of your file and Windows has it hidden… try this… open the folder where you saved your style.css, go to tools->folder options and select the “view” tab. Then uncheck “hide extensions for known filetypes” and then click “ok”. If my suspicion is correct, your style.css will become style.css.txt… just rename it to drop the .txt and you’ll be fine unless there’s another problem somewhere.
Forum: Themes and Templates
In reply to: No themes are working for me Please help!No problem… glad it’s working.