Forum Replies Created

Viewing 15 replies - 196 through 210 (of 218 total)
  • I’m not for sure, but you might check to make sure that the single quotes around function_exists(’register_sidebars’) are not curly quotes – I know that sounds silly, but just open up functions.php, delete the single quotes around register_sidebars, and then type them back in.

    It looks like maybe you’ve got curly quotes in there (because those are what showed up in my first post), and that could be causing the problem (php wont read curly quotes properly).

    Forum: Plugins
    In reply to: remove posting ability

    If you’re ok with editing core files (I’m not sure if there’s a way to do this without editing the core – if there is, I’d love to hear about it!), just open up wp-admin/menu.php, and look for this code block:

    $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'wp-menu-open menu-top', 'menu-posts', 'div' );
    	$submenu['edit.php'][5]  = array( __('Edit'), 'edit_posts', 'edit.php' );
    	$submenu['edit.php'][10]  = array( _c('Add New|post'), 'edit_posts', 'post-new.php' );
    	$submenu['edit.php'][15] = array( __('Tags'), 'manage_categories', 'edit-tags.php' );
    	$submenu['edit.php'][20] = array( __('Categories'), 'manage_categories', 'categories.php' );

    Comment that whole block out, so it looks like this:

    /*
    $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'wp-menu-open menu-top', 'menu-posts', 'div' );
    	$submenu['edit.php'][5]  = array( __('Edit'), 'edit_posts', 'edit.php' );
    	$submenu['edit.php'][10]  = array( _c('Add New|post'), 'edit_posts', 'post-new.php' );
    	$submenu['edit.php'][15] = array( __('Tags'), 'manage_categories', 'edit-tags.php' );
    	$submenu['edit.php'][20] = array( __('Categories'), 'manage_categories', 'categories.php' );
    */

    and the entire posts menu will dissapear.

    The problem is with those flash embeds – there’s some really weird code going on in there that is messing things up and closing out divs before they should be. Are you using a plugin to insert them?

    orjuela, you can do it like this:

    <?php
    if(!empty(get_post_custom_values("image07urlLarge")){
    ?>
    <a rel="lightbox[hemingway_block]" href="<?php $values = get_post_custom_values("image07urlLarge"); echo $values[0]; ?>"><img class="imgblock" src="<?php $values = get_post_custom_values("image07urlThumb"); echo $values[0]; ?>" alt="<?php the_title(); ?>" /></a>
    <?php
    }
    ?>

    All I did was surround the whole thing in an if statement – it says that if that custom field is not empty, display the code, if not, just skip it.

    Hope it helps, 6 months later…

    Here’s one way you could do it:

    In your template file where you want to implement this (single.php for post pages, index.php for the homepage, etc), find

    the_title();

    Every time you find the_title(), replace it with this:

    if(strlen($post->post_title)>5){echo substr($post->post_title,0,5).'...';}else{the_title();}

    Just replace the 5s with however many letters you want in your titles.

    Heres what you need to do:

    Put this code in your functions.php file:

    <?php
    if ( function_exists(’register_sidebars’) )
    register_sidebar();
    ?>

    That registers a widgetized sidebar for you. Now, you need to place that sidebar on your theme, so in sidebar.php, use this code:

    <ul>
        <?php dynamic_sidebar(); ?>
      </ul>

    and it should work fine. If you need multiple widgetized sidebars, it gets a little more complicated, but not much.

    You can change that fairly easily. In the theme folder, open archive.php, and find this block:

    <?php while (have_posts()) : the_post(); ?>
    <li class="archive-post">
    <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    <div class="small"><? printf( __('%1$s at %2$s', 'blocks'), get_the_time(__('l, F jS, Y', 'blocks')), get_the_time(__('H:i', 'blocks')) ); ?> | <?php comments_popup_link(__('No comments', 'blocks'), __('1 comment', 'blocks'), __('% comments', 'blocks')); ?><?php edit_post_link(__('Edit', 'blocks'), ' | ', ''); ?></div>
    <div class="small"><?php _e('Categories: ', 'blocks'); the_category(', ') ?></div>
    <div class="small"><?php _e('Tags: ', 'blocks'); the_tags('', ', ', ''); ?></div>
    </li>
    <?php endwhile; ?>

    Then add <?php the_content(); ?> in after the H3 block, like this:

    <?php while (have_posts()) : the_post(); ?>
    <li class="archive-post">
    <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    <p><?php the_content(); ?></p>
    <div class="small"><? printf( __('%1$s at %2$s', 'blocks'), get_the_time(__('l, F jS, Y', 'blocks')), get_the_time(__('H:i', 'blocks')) ); ?> | <?php comments_popup_link(__('No comments', 'blocks'), __('1 comment', 'blocks'), __('% comments', 'blocks')); ?><?php edit_post_link(__('Edit', 'blocks'), ' | ', ''); ?></div>
    <div class="small"><?php _e('Categories: ', 'blocks'); the_category(', ') ?></div>
    <div class="small"><?php _e('Tags: ', 'blocks'); the_tags('', ', ', ''); ?></div>
    </li>
    <?php endwhile; ?>

    That should do the trick, although you may have to do some extra styling with css to get it to look the way you want it to.

    Edit: The code I pasted was a mess. This should format a little better.

    Forum: Plugins
    In reply to: Receiving $_POST info?

    Where exactly ar you trying to receive the post data – on an admin panel, or on the frontend somewhere?

    Regardless, you should be able to access the variables with $_POST[‘myvariable’] no matter where you are in the code.

    If you’re just trying to update some options on a wordpress admin panel, there is an easier (and better) way to do it, detailed here: https://codex.www.ads-software.com/Creating_Options_Pages (check near the bottom, at “See it all together” to see how they tell wordpress to automatically update options from form fields).

    I’m not sure what that site is using, but judging by the permalink structure, I’d guess that it’s not wordpress.

    Looks ok to me in Firefox and Safari – did you fix it, or is it an IE problem?

    Here’s a jquery plugin that does that sort of thing – is this hat you’re looking for?

    https://leandrovieira.com/projects/jquery/lightbox/

    Forum: Plugins
    In reply to: Adding Google Adsense

    There are a number of plugins out there that will give you more options as to how and where your ads show – here’s one you can try:

    https://www.ads-software.com/extend/plugins/adsense-manager/

    JHouse is right on – whatever traffic loss you noticed after installing this plugin is either coincidental, or related to large scale changes in title/meta info on already ranked pages.

    I’ve had significant experience with this plugin, and there just isnt anything in it that could penalize a user – outside of a short term loss due to reindexing/significant cache changes.

    I got this working using this method:

    How-To include tinyMCE in your WP plugin

    Everything works, including the image uploader – One important note that stole 3 hours of my life: The user must have “Use Visual Editor” checked!

    I came up with a solution – I needed to get my hands in there before wordpress could decide the page needed to be 404d, so I added a filter to remove the limit clause from the end of the db query – now, as long as there is a single post in the category, wordpress won’t try to 404 it.

    A side note for anyone who ends up with a similar situation – I needed this to happen only for a certain category, but because the action happens before is_category is even set, I had to use another query filter to test for it. Here’s the complete code:

    add_filter('request','SOTWrequest');
    
    function SOTWrequest($request){
      if($request['category_name'] == 'sotw'){
        add_filter('post_limits', 'SOTWcustomquery');
      }
      return $request;
    }
    
    function SOTWcustomquery($limit){
      return '';
    }

    Hope this helps someone!

Viewing 15 replies - 196 through 210 (of 218 total)