wpismypuppet
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: WP_Get_Referer & Divs???You know what? The more I thought about it, the less JavaScript and $_SERVER[‘QUERY_STRING’] you need. In other words, you need zero of both. It’s late, forgive me.
Here’s what you do… on the main page that has your sections, append the query string to the hyperlink itself. For example, your news section has a hyperlink to http://www.testdomain.com/testpage, right? Simply add
?fromwhere=newsto the end. So something like:<a href="http://www.testdomain.com/testpage?fromwhere=news">click me</a>You get the idea… anyways, on your page that does the detection, I’d add the following (note that it’s all your code from above with mine inserted):
<?php $referer = $_SERVER['HTTP_REFERER']; if ( $referer == "http://www.testdomain.com/testpage" ) { if( isset( $_GET['fromwhere'] ) { if( $_GET['fromwhere'] == 'news' ) { // Do something }else if( $_GET['fromwhere'] == 'someothersection' ) { // Do something else } }else { echo '<div id="bgphotos"></div>'; } } else { echo '<div id="bgvideos"></div>'; } ?>This isn’t tested, but should work just fine. It will at least point you in the right direction. Also, please note that when you write PHP code, you should ALWAYS open code blocks with
<?phpand not just<?.<?can also declare XML and some other languages, so it’s best to forget the short code ever existed! 🙂Forum: Fixing WordPress
In reply to: Something is wrong with my wordpress siteI don’t think I quite get your problem. Page one will always show the latest blog posts… pages 2, 3, 4, etc… will show older ones. Blog posts show newest to oldest. Can you try to explain the issue a little better?
Forum: Fixing WordPress
In reply to: WP_Get_Referer & Divs???JavaScript is your friend… You could simply use JavaScript to update the URL query string on click. Then you could use
$_SERVER['QUERY_STRING']and add that to your already existing if/else statement. Let me know if you need some help with that.jQuery will make short work of it since WordPress already has jQuery up and running.
Forum: Fixing WordPress
In reply to: Stuff getting wiped out for no reason.Yes… It’s a common problem with the way the default visual editor tries to “format” the code. The only solution is to stay in HTML mode and never go back!!! Or use a different visual editor other than the default!
What we do is use Gravity Forms. It’s $40 for one site, more money for more sites. But it’s basically JotForm built into WordPress. So easy to use, only one login. I know you probably don’t want to pay money for anything… but we used JotForm for a long time until we found this plugin.
If you are set on keeping JotForm, then you can try to use Ultimate TinyMCE or even TinyMCE Advanced. Either of these two will alter the visual editor and improve performance switching between HTML and Visual editors. Let me know if this helps…
Forum: Fixing WordPress
In reply to: Show excerpts on video category page only?You are welcome! Glad I could help.
Forum: Fixing WordPress
In reply to: Retun Taxonomy TermsIf you’re first block of code was giving you an array, simply loop through the array and echo out what you need.
$myterms = get_post_meta( $post->ID, 'province' ); foreach( $myterms as $term ) { echo ( $term->name ); }You may need to add other HTML code to make it look how you want, of course.
Forum: Fixing WordPress
In reply to: Retun Taxonomy TermsHmmm… I’m not sure if there might be a typo in your code. Are you trying to get a list of all the terms for the ‘provinces’ taxonomy and list them? Or are you trying to get a list of all the ‘provinces’ taxonomy terms for the given post?
In your second bit of code, you are using
get_term(). This function takes the term id and the taxonomy the term resides in. You are passing the post id:$myterms = get_term( $post->ID, 'provinces' );Let me know what you are trying to do and I can offer more help. There are two totally different answers based on how you want to get the terms. For what it’s worth, your registering of the taxonomy looks right 🙂
Forum: Fixing WordPress
In reply to: Show excerpts on video category page only?I don’t know if you’re using the right function in the right place. I’m also not entirely sure what you are looking for. However, I have an idea that you could try. It looks like you want to use the first function above and use
the_excerpt()unless you’re in the “videos” category, correct? Try:/* muimedia_post_entry_summary */ if ( !function_exists( 'muimedia_post_entry_summary' ) ) { function muimedia_post_entry_summary() { ?> <div class="entry-summary"> <?php if (has_post_thumbnail()){ ?> <a href="<?php the_permalink() ?>" title="<?php the_title_attribute( array('before' => esc_attr__( 'Permalink: ', 'muimedia' ), 'after' => '')); ?>" rel="bookmark"><?php the_post_thumbnail(); ?></a> <?php } ?> <div id="categorysummary"> <?php if( in_category( 'videos' ) ) { the_content(); }else { the_excerpt(); } ?> </div> </div> <?php } }As you can see, the only place I made a change was where you are pumping out
the_excerpt(). I added a simple if/else statement to check to see if the post you are looking at is “in” the video category. If you are in that category, show the content, otherwise show the excerpt. Hope this is what you were looking for.Forum: Fixing WordPress
In reply to: Show Modified Date only if modifiedI tend to think that you’d want the date no matter what. This way people know when the file was last “updated”, even if it means that is when the file was created! This let’s people know how old the content is.
To answer your question though, you would need a custom SQL query before you pump out the modified date. You’ll need to gather the “post_date” and compare that to the modified date. If they are equal, don’t echo the_modified_date. If they aren’t equal, show it!
Read up on:
http://codex.wordpress.org/Class_Reference/wpdb
And use the posts table to gather the post_date field.
Forum: Fixing WordPress
In reply to: Nivo slider problemThere is nothing wrong with the Nivo Slider itself. It’s working the way it was designed. The issue lies with the images. Nivo Slider requires all images to be the exact same dimesions, and NOT .png (though .png does work, you’re seeing the reason they don’t recommend it).
Your options are to either make sure all the images are physically the same dimensions by stretching them, or add white (or another background color) around the image to “fake” the way the image looks and assure they are all the same dimensions.
Forum: Fixing WordPress
In reply to: I Edited Page on Site but URL has changedAny time… Glad I could be of some help. Please be sure to mark this resolved so others know.
Forum: Fixing WordPress
In reply to: Permanent URL RedirectGlad I could help. Also I read through your post on “URL Redirection For WordPress Multisite Subdomains” and it’s good… but there are some steps that could be simplified. Especially if the person has access to the SQL database. If you’d like some help writing that up, let me know.
On a daily basis, we create “test” sites on our website using sub-domains. When the site is ready to go live, we port the entire WordPress site over to their domain. Similar to what you are doing here. The steps we use are shorter and easier and don’t require recreating anything, even the widgets.
Forum: Fixing WordPress
In reply to: JSMin.phpYou are welcome.
Forum: Fixing WordPress
In reply to: "Two Level" Portfolio FilteringSorry, can’t help you there. Unfortunately we build our own themes where I work, so I can’t offer any out-of-the-box solutions. If you decide to try coding it yourself, let me know and I can offer advice and tutorials. Good luck.
Forum: Fixing WordPress
In reply to: search widget on my non-wordpress home page?You are welcome. Please mark this post as resolved so other people know. Glad I could help!