Forum Replies Created

Viewing 15 replies - 76 through 90 (of 92 total)
  • Have you happened to have found a solution? I am interested in the same thing.

    (sorry to post when I don’t have a solution; but sometimes members answer their own questions but don’t post the solution for the masses)

    Forum: Plugins
    In reply to: Contact List Plugin

    There is also Little Black Book which has been edited for more North American-centric styling. (Little Black Book being a variation of “AddressBook” listed above FYI)

    Thread Starter Copernicus

    (@copernicus)

    I’m not sure that this is an ideal solution for the issue above, but for anyone else experiencing this same issue, I’ve found that the “Missing argument 1 for in_category() in _____/category-template.php” error arose from the set-up of the conditional tags within the sidebar.

    Originally, I had employed the following code:

    <div class="sidebar">
    <?php if ( is_404() || is_category() || in_category() || is_single() || is_day() || is_month() || is_year() || is_search() || is_paged() || is_page() ) { ?>
    ...

    This code enabled any of those conditions within the sidebar (the code goes on to lists specific content for any of the individual conditions, such as

    <?php /* } elseif (is_category('1')) { ?>
    <h3>Headline/Content Here</h3>

    etc.)

    Although the other conditional tags were operating correctly with the empty arguments (such as “is_category()”), the empty “in_category()” in that opening
    code above was producing the “Missing argument” error.

    When I changed the code above to

    <div class="sidebar">
    <?php if ( is_404() || is_category() || in_category(7) || is_single() || is_day() || is_month() || is_year() || is_search() || is_paged() || is_page() ) { ?>

    everything started working correctly (with no errors!).

    I assume one would have to add an “in_category” instance for each category that requires a specific conditional tag later in the sidebar’s code.

    For example,

    <div class="sidebar">
    <?php if ( is_404() || is_category() || in_category(7) || in_category(8) || in_category(9) || is_single() || is_day() || is_month() || is_year() || is_search() || is_paged() || is_page() ) { ?>

    (where category ID numbers 7,8 & 9 will have specific conditional tags within the sidebar)

    I hope this helps.

    Thread Starter Copernicus

    (@copernicus)

    Hi moshu, thanks for the help! I have tried in_category — strangely, it almost works (displaying the posts in the category as desired but ALSO provides me with the error Warning: Missing argument 1 for in_category() in _____/category-template.php on line 170)

    Even though I have the conditional tag of <?php } elseif (in_category('7') && is_single()) { ?> (where “7” is the category of posts I wish to display)

    I don’t know how to get beyond that error with the use of in_category within the sidebar.

    I know it has been a LONG time since this post was started. But, I’ve been searching with a similar problem and have devised the following solution (which I’m posting here to help out anyone else in the same boat).

    Desired Outcome: I wanted to call the category’s slug (or “nicename”) to apply individual classes to an H1 tag depending on the category being viewed. Thus, I wanted to use the category slug as a style class name.

    My Solution: The following code calls the category slug (or “nicename”) as a style.

    <div>
    <?php $this_category = get_category($cat); ?>
    <h1 class="<?php echo $this_category->category_nicename; ?>">Text here.</h1>
    </div>

    So, for a category with a slug of “photos,” the code above would produce:

    <div>
    <h1 class="photos">Text here.</h1>
    </div>

    (and, yes, the <div> tags are just provided to help clarify the boundaries of the code snippet — thus, they are NOT necessary for proper operation.)

    Yay!

    Update: I apologize for the error above. The calling of the custom CSS did work with the method I described. (It was a simple matter of the old version of “tiny_mce_gzip.php” being stuck in the site cache.)

    And, as a bonus, I’ve solved the issue of the “relative” path for the custom css.

    As noted above, my absolute path was something like:
    http://www.mydomain.com/wp-content/themes/mythemename/editor.css

    And, if you look at “”tiny_mce_gzip.php” under the called for initArray (where we’ve added the “content_css :” line) you’ll see a line that reads:
    "document_base_url : "<?php echo trailingslashit(get_bloginfo('home')); ?>",
    This code sets the base directory for WordPress. So, you can make a relative path from here and it will work fine.

    In my example, I switched my absolute path to "/wp-content/themes/mythemename/editor.css" and it works fine.

    Hope this helps!

    Hi Watershed,

    Can you provide any specifics on how you’ve modified the file “tiny_mce_gzip.php” to accommodate the styles selector?

    Under the call for “initArray” within the file “tiny_mce_gzip.php” (at, approximately, line 161) I’ve added the line content_css : "http://www.mydomain.com/wp-content/themes/mythemename/editor.css"
    (where “editor.css” is a specific CSS file intended for the drop-down style selector within the WYSIWYG editor in WP).

    However, this didn’t seem to have an effect, since the WYSIWYG editor only still offers the styles of “mce_plugin_wordpress_more” and “mce_plugin_wordpress_page”.

    How did you get it working so that the styles from your CSS file (such as “editor.css” in my case) were available from the drop-down?

    (If you can show me how to make it work with an absolute path to the CSS, I’ll do what I can to make the relative path work!).

    Thanks!

    Thread Starter Copernicus

    (@copernicus)

    Foolish me. I think I was making this much more difficult than it needs to be.

    Although, I’d still be interested in how one “echo’s” PHP tags like this for WP’s Conditional Tags system… there is a better method for implementing the changes I want.

    Using PHP include tag for the Sidebar call within a template to just serve a different sidebar entirely, rather than writing complex Conditional Tags seems like the best solution.

    (See: http://codex.wordpress.org/Customizing_Your_Sidebar — the section entitled “Different Sidebars Anyone?”)

    Although the base question of this thread has not been answered, I’m marking it as “Resolved” since a fine solution has been found.

    Thanks again to Kafkaesqui for the help!

    Thread Starter Copernicus

    (@copernicus)

    Thank you Kafkaesqui! Thank you for the original code & for your helping me implement it properly!

    I had reviewed the get_posts page before and (believe) I have the method for displaying the post data. My question was more about the accuracy of calling the code from within a conditional tag.

    Perhaps it would have been clearer, had I included more of the code which I’ve tried to employ…

    (I apologize for the mess of this following code; I’m just learning & trying my darndest to make something nice & efficient)

    <?php if ( is_category() ) {
    if (is_category('3')) {
    // Special Code Here for Category 3
    ...
    ...
    } else {
    // catch-all for other categories
    echo "<li><h2>Section Title</h2>";
    echo "<ul>";
    echo "$photog_posts = get_posts('category=2&numberposts=10');";
    echo "foreach($photog_posts as $post) : setup_postdata($post);";
    echo "<li>";
    echo "<a href=\"";
    echo the_permalink();
    echo "\" rel=\"bookmark\" title=\"Permalink to";
    echo the_title();
    echo "\">";
    echo the_title();
    echo "</a></li></ul>";
    echo "</li>";
    }
    }
    ?>

    This whole use of the foreach() within the Conditional Tags is what is causing me such trouble.

    At least, that’s what I think my problem is; unless I’m completely misunderstanding something.

    (thanks again for any & all help!)

    Thread Starter Copernicus

    (@copernicus)

    Thank you for your help moshu, but I don’t think that is the way to solve the issue.
    Since that instance of “get_the_title” only references the current page/post.
    What I need to do is call the title of (any) page to display within a completely different page. Furthermore, that call of the title needs to be in the page’s content, not in The Loop.

    Any ideas?

    (thanks again)

    THANK YOU! Your figuring this out (and posting the solution) has helped me as well! THANK YOU! THANK YOU! THANK YOU!

    Thread Starter Copernicus

    (@copernicus)

    Viper007Bond: THANK YOU.

    Thank you, thank you, thank you.

    In all my searching, I never saw that “mini-plugin.” It is absolutely perfect; and, from what I’ve seen in these support forums, a plug-in for which many more people are looking. Hopefully, this post will help them find it.

    (also: your video Quicktag plug-in looks quite good. I’ll download that for future reference!)

    Thread Starter Copernicus

    (@copernicus)

    OK, I may have found the solution (I’m not 100% on this, so verification from someone else would be greatly appreciated!) and am posting it here so that others searching for the same problem might find my solution helpful.

    1. Visit http://tinymce.moxiecode.com/tinymce/docs/reference_buttons.html to find the name of the button you are interested in added. In my case, I wanted to add a method for applying a format to a paragraph (h1, h2, etc.) this is called “formatselect.”
    2. Open the file “tiny_mce_gzip.php” in the “tinymce” folder within the “js” folder that’s within the “wp-includes” folder. So, it’s wp-includes>js>tinymce>tiny_mce_gzip.php
    3. Find the code that reads:
      $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright' ,'separator', 'link', 'unlink', 'image', 'wordpress', 'separator', 'undo', 'redo', 'code', 'wphelp'));
    4. Add the button name that you wish to have show up in the button array. In my case, I wanted “formatselect” so I modified the code to display as:
      $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'separator', 'formatselect', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright' ,'separator', 'link', 'unlink', 'image', 'wordpress', 'separator', 'undo', 'redo', 'code', 'wphelp')); (adding both “formatselect” and a separator)

    That’s it!

    I am also trying to find out how to do this.
    Is there a way to modify the standard buttons on the new WYSIWYG editor in WP2?
    I’m trying to add a “style select” dropdown in order to apply styles to text while posting.

    Please help!

    Thread Starter Copernicus

    (@copernicus)

    Anyone able to help with this? …please… 🙂

Viewing 15 replies - 76 through 90 (of 92 total)