Forum Replies Created

Viewing 15 replies - 1 through 15 (of 17 total)
  • See also:
    Including WordPress’s comment-reply.js (the right way)

    Since threaded comments were enabled in WordPress 2.7, most themes include the following line in header.php

    <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    This code checks if the visitor is browsing either a page or a post and adds the JavaScript required for threaded comments if they are.

    I prefer a slight variation

    <?php
    if ( is_singular() AND comments_open() AND (get_option('thread_comments') == 1))
      wp_enqueue_script( 'comment-reply' );
    ?>

    My variation checks if the visitor is browsing either a page or a post, if comments are open for the entry, and finally, if threaded comments are enabled. If all of these conditions are met, the JavaScript required for threaded comments is added.

    If you run your wp_enqueue_script calls in functions.php, as I do, this is the code to use:

    <?php
    function theme_queue_js(){
      if (!is_admin()){
        if ( is_singular() AND comments_open() AND (get_option('thread_comments') == 1))
          wp_enqueue_script( 'comment-reply' );
      }
    }
    add_action('get_header', 'theme_queue_js');
    ?>

    The call is added to the get_header action as is_singular and comments_open are unknown during the init action.


    TeMc

    A very simple even-odd maker :

    $e_o = "even"; // Set it to even on the first time
    	foreach($tests as $test){
    
    		<div class="<?php echo $e_o; ?>">
    
    		// do your loop stuff
    
    		</div>
    
    		// if $e_o is now "even" it becomes "odd", else it becomes "even"
    		$e_o = ($e_o == "even") ? $e_o = "odd" : $e_o = "even";
    }


    gd

    Hey, I found it !!

    I was browsing the plugin’s php files and saw a file called -custom-fields.php

    It turns out eShop does indeed store it’s data in custom fields;

    Here’s the overview of a few examples:

    $sku = get_post_meta( $_REQUEST[ 'post' ], '_Sku' );
    $prod=get_post_meta( $_REQUEST[ 'post' ], '_Product Description' );
    $shiprate = get_post_meta( $_REQUEST[ 'post' ], '_Shipping Rate' );
    $featured = get_post_meta( $_REQUEST[ 'post' ], '_Featured Product' );
    $stkav = get_post_meta( $_REQUEST[ 'post' ], '_Stock Available' );
    $stkqty = get_post_meta( $_REQUEST[ 'post' ], '_Stock Quantity' );
    $optsets = get_post_meta( $_REQUEST[ 'post' ], '_eshoposets' );

    So, in page.php (or page-product.php if you have a seperate Page Template for it (which I’d recommend))
    You can use something like this:

    $prodDecr = get_post_meta($post->ID, '_Product Description', true);
    if (!empty($prodDecr)) {
    	echo "<span class='product-description'>" . $prodDecr . "</span>";
    }

    Apparently the plugin changes in the past 10 months and/or the Elfin/topic-starter ment something else.


    gd

    @enfin:

    Isn’t is possible to make eShop store all it’s data that is entered in eShop’s write panel on the Edit Page-page be stored in a custom field ?

    ie. custom-field-key’s like “eshop_cf_sku”, “eshop_cf_productdescription”, “eshop_cf_shiprate”, “eshop_cf_featuredproduct”, “eshop_cf_stock” , “eshop_cf_imgurl”

    That way it’s possible to pimp our products pages a little to our imagination.

    Currently all I got is a Shop Home that’s generateed by a eShop shortcode (with images), but the products page (which is just page.php and the_content()) – doesn’t display the asociated image or any data I want on it.

    Only thing that differs my product page from a default page is the appended block with Order/Quanty/Add to card-options.


    gd

    Simply q=100 in the url is enough.

    ie.

    https://mydomain.com/timthumb.php?w=200&h=250&q=100&src=https://mydomain.com/path/to/image.jpg


    gd

    If you want to add a class of your own use this:

    <li <?php comment_class('myClass'); ?> id="comment-<?php comment_ID(); ?>">

    It works just like post_class().

    Hope that helped,

    gd

    Thanks a lot !

    *bump*

    Can we, and if so, how can we use conditional tags inside plugins ?
    Or… how can we make a plugin only load on a certain page (to save load with both parties).

    Like only load plugin X on homepage, only load plugin X if is_admin, only load plugin X if is_single, all kinds of stuff.

    PS: I think is_admin() does work though.

    Thread Starter grizzdesign

    (@grizzdesign)

    For later reference;

    I fixed the issue by using the new version from https://wpaudioplayer.com/standalone

    The difference is that with the new version you’re now not making the entire object- and embed-tags yourself, instead you use a small piece of javascript on the page.

    Works a lot better, includes the auto-stopper and is also easier to customize since all you need is the URL to the file. The rest (background, animation etc.) is defined globally in the <head>-sectional javascript-snippet.

    Thread Starter grizzdesign

    (@grizzdesign)

    Since I figured I might have made a flaw in the code I have mirrored the Macloo-page in a temporary location:
    https://bit.ly/grizzdesign-1
    ^ is a copy of: https://www.macloo.com/examples/audio_player/options.html

    Also, another page werre it auto-stops:
    https://www.1pixelout.net/code/audio-player-wordpress-plugin/#examples
    and the copy: https://bit.ly/grizzdesign-3

    And again… It doesn’t work.

    It is very annoying that this ain’t working.

    If anyone has a clue on what I’m doing wrong, please answer !


    Thanks in advance,
    gd

    I want the same thing done… Comments off by default on new pages.

    Reason being the RSS-feed being putted into wp_head().

    Deleteing the comments_template() doesn’t uncheck the box in the page-editor and thus doesn’t get rid of the RSS feeds on page for “comments”.

    So, question remains:
    How can me make a setting that will automaticly disable comments for pages (and leave it on for comments) – OR – how can we get rid of the RSS-feeds for comments on PAGES.


    Thanks in advance,
    gd

    I have the same thing.

    I had WP e-Commerce on one site, and it sent out mails perfectly when a customer makes purchase. And on another website it doesn’t.

    The only difference I see is that the one working uses WP 2.8 and the default theme (A test site), and the one not working is a WP 2.7.1 with a self-made theme.

    I doubt the theme’s have anything to do with this, so my thougts go to the WP version. But how does this makes sense ?

    I actually choose for WP 2.7.1 on the actuall site becuase several things don’t work good (yet) in WP 2.8 with WP E-commerce.

    So the big question is.. How do we fix the automated outgoing mails from E-commerce in WP 2.7.1 ?

    Can’t wait for an answer as it’s a very important function of my shop.
    –Greetings

    Could you provide the name of the plug-in aswell ? Just for archive purpuses and for other people who have / will encouter this issue. ??

    Thread Starter grizzdesign

    (@grizzdesign)

    Anyone ? I’m kindof in a hurry on this one :/

    I’ve tried both wp-content/languages and wp-includes/languages.

    * Checked permissions (both file and folder) (chmoded to 777 for sake of test)
    * Checked latest update of both lang-files and WordPress (2.7.1)
    * Tried nl-NL, nl_NL and nl in wp-config.php

    So, the 3 steps I have basicly done so far:
    – Install wordpress
    – upload .mo and .po files into language folder
    define ('WPLANG', 'nl_NL'); in wp-config.php

    Is there anything else required ? Or are there exceptions possible ?
    What am I doing wrong, are there known bugs ? Anything ?

    PS: So I want the blog to be Dutch-only. No need for multi-language in any way. Just get into Dutch.
    PS2: The nl_NL.mo/nl_NL.po -files are currently the only 2 files in the languages folder in both wp-content and wp-includes.

    Thread Starter grizzdesign

    (@grizzdesign)

    There is no such menu on my General settings page…

Viewing 15 replies - 1 through 15 (of 17 total)