Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all 8245 articles
Browse latest View live

tnoguchi on "Display Groups of Custom Posts by their Custom Taxonomy Term"

$
0
0

Hi,

I'm trying to output a portfolio page composed of sections of CPT post thumbnails organized by their custom taxonomy term slugs.

While it's easy for me to output the terms associated with the custom taxonomy, I'm not sure how one nests a custom query to retrieve the posts associated with each term in the foreach loop.

I've included the code that I've worked on; but this is a bit beyond my PHP skill level.

//retrieves an array of the terms as slugs
$terms = get_terms('tn_cstm_work_taxonomy', 'fields=names');

// This returns all posts in the custom taxonomy, rather than posts for each term
    $projectsArgs = array(
            'tax_query' => array(array(
                    'taxonomy' => 'tn_cstm_work_taxonomy',
                    'field' => 'slug',
                    'terms' => $terms
            ))
          );

        foreach ( $terms as $term ) {        ?>
      <div class="row">
//Populates the the section and titles with the slug; needed for navigation
        <section id="<?php echo $term; ?>" class="large-12 columns" data-magellan-destination='<?php echo $term; ?>'>
           <h3><?php echo $term; ?></h3>
           <ul class="large-block-grid-4 small-block-grid-2">

            <?php
            $projects = new WP_Query($slug); while ($projects->have_posts()) : $projects->the_post(); ?>

              <li>
                  <?php
                        //outputs thumbnails for gallery
                         if(function_exists('tn_cstm_work_thumb')) {
                          tn_cstm_work_thumb();
                    ?>
              </li>

            <?php endwhile; wp_reset_postdata(); ?>

          </ul>
        </section>
      </div><!-- .row -->     

<?php } ?>

This is obviously incorrect, the custom query will just pull all of the posts associated with any term in the custom taxonomy. Is there a way to output just the posts associated with each term?

Any hints, or help would be appreciated.

Thanks!


syced on "No data in $_POST"

$
0
0

Hello,

I'm writing a front-end function where a user fills in a form. But for some mysterious reason it doesn't send any data through $_POST.

This is my material:
- I have two WordPress running at one server with two different accounts.
- Account_A has the latest 3.6.1 WP version and my script works great.
- Account_B was outdated, I just updated it to 3.6.1 but my script doens't work.

Account_B is the client's website. Thats why I scripted it first at Account_A and made it work there. There are several plugins running at Account_B (ACF/Gravityforms/Members/Wordpress SEO Yoast) and there are 0 plugins (besides my own I'm creating right now) running at Account_A

The code:

<form action="<?php echo $siteurl; ?>/dictee/" method="post">
                    <label>Voornaam</label>
                    <input name="voornaam" />
                    <label>Achternaam</label>
                    <input name="achternaam" />
                    <label>E-mailadres</label>
                    <input name="emailadres" />
                    <input type="submit" value="Ga verder" />
                </form>

PHP code (on top of the template file):

if($_SERVER['REQUEST_METHOD'] == 'POST') {

				$voornaam = $_POST['voornaam'];
				$achternaam = $_POST['achternaam'];
				$emailadres = $_POST['emailadres'];
}

Resuls are empty.
Now when I create this plugin without WordPress (so basicly run it at the root with pluginnaam.php) It works great. But once it makes use of the "rewriting" it fails to parse any data.

The weirdest thing is, on installation A it works fine the way it should. But installation B fails at parsing the data.

Does anybody have any idea wich or what can be bugging with installation B?

My "thoughts" are that the problem goes with the rewriting, since a stand alone version works fine (meaning the server should not be the problem). On the other hand, Installation A works great with the same rewriting.

webwerk on "[Plugin: WordPress-to-lead for Salesforce CRM] Additional form field types?"

user256 on "Plugin settings page outputing whitespace underneath"

amosglenn on "WP_Query doesn't seem to filter with meta_query"

$
0
0

I've added a loop to a template used for a single post, but WP_Query doesn't seem to filter the posts collected according to their meta fields

I created two custom post types: "issue" and "article".
"Issues" have post ids (obviously). And each "article" has a meta-field called "journal_article_in_issue" containing the post id of the issue to which they belong.

I'm trying to use WP_Query to collect all the posts with both the post-type of "article" and an "in-issue" value equal to the current issue post id.

This is the code intended to act as a loop within the single-issue template. It does collect all the posts with the post_type of 'article', but it is collecting all the posts regardless of the value of the 'journal_article_in_issue' meta field.

<?php
$issue_id=get_the_ID();
$post=get_post($issue_id);
?>

<!-- do some stuff with the single issue's information -->

<!-- display articles in issue -->
<div class="journal-issue-contents">
    <?php
        $article_query_args = array(
                    'post_type' => 'article',
                    'meta_query' => array(
                             'journal_article_in_issue' => $issue_id
                     )
        );
        $article_query = new WP_Query($article_query_args);
        if($article_query->have_posts()) {
            while($article_query->have_posts()) {
                $article_query->the_post();
                echo '<div>' . get_the_title() . '</div>';
            }
        }
    ?>
</div>

The example page is http://amosglenn.com/ssa/issue/january-june-2013/

Full template file is at http://pastebin.com/gX2D0X9r

Thanks!

bjarvis2785 on "Manually changing post status via MySQL command"

$
0
0

Hi All,

I recently paid a developer to code a system for my new website that does some stuff when a post is changed from 'Draft' to 'Published'.

I now have a problem, that he's left us with an incomplete script, that is no good to us unless we can fix the problem below.

The system he created adds a button in the admin panel that i press to 'approve and publish' the post.
I DO NOT press the default WP Publish button.

His script then does it's bit of processing and then updates the database directly to change the post status to 'Publish'.

However, what i'm finding is, when the post is created (via Gravity forms) and saved as a draft the post slug (that forms part of the permalink) is in tact as it should be.
Then when i 'approve and publish' the post, after is script has worked (and successfully published the post) the post slug is actually blank.

If i look at the database for that post i can see that the 'post_name' field is actually blank too.

Does anybody know why this would be happening... there's obviously something in the default publish function that inserts the 'post_name' data in to that field in the database... i'm guessing by manually updating the post status in the DB we're missing this step.

Hope this makes sense and somebody is able to help!?

mak1wp on "Category select function within page builder post loop"

$
0
0

Hi,

I've been working with a page builder plugin from site origin which is capable of listing a post loop (via widget) and arranging the posts in order of date, post ID, comment count and others but it does not list Post by Category.

I've been trying to add this functionality but my PHP and wordpress skills aren't strong enough. Are there any WP hero's about who would find this easy to do and help me achieve this category specific listing of the post loop?

I've included the code from the plugin which enables the post loop widget - which is missing the category select. Its a fairly long script as its showing all of the other options included in the post loop function.

Many many thanks to anybody that replies!

class SiteOrigin_Panels_Widgets_PostLoop extends WP_Widget{
	function __construct() {
		parent::__construct(
			'siteorigin-panels-postloop',
			__( 'Blog Posts', 'so-panels' ),
			array(
				'description' => __( 'Displays a post loop.', 'so-panels' ),
			)
		);
	}

	function widget( $args, $instance ) {
		if(empty($instance['template'])) return;

		$template = $instance['template'];
		$query_args = $instance;
		unset($query_args['template']);
		unset($query_args['additional']);
		unset($query_args['sticky']);

		$query_args = wp_parse_args($instance['additional'], $query_args);

		global $wp_query;
		$query_args['paged'] = $wp_query->get('paged');

		switch($instance['sticky']){
			case 'ignore' :
				$query_args['ignore_sticky_posts'] = 1;
				break;
			case 'only' :
				$query_args['post__in'] = get_option( 'sticky_posts' );
				break;
			case 'exclude' :
				$query_args['post__not_in'] = get_option( 'sticky_posts' );
				break;
		}

		if ( !empty( $instance['title'] ) ) {
			echo $args['before_title'] . esc_html( $instance['title'] ) . $args['after_title'];
		}

		// Create the query
		query_posts($query_args);

		echo $args['before_widget'];
		locate_template($instance['template'], true, false);
		echo $args['after_widget'];

		// Reset everything
		wp_reset_query();
		wp_reset_postdata();
	}

	function update($new, $old){
		return $new;
	}

	function get_loop_templates(){
		$templates = array();

		$files = glob(get_template_directory().'/columns*.php');
		foreach($files as $file){
			$templates[] = basename($file);
		}
		$files = glob(get_stylesheet_directory().'/columns*.php');
		foreach($files as $file){
			$templates[] = basename($file);
		}
		$templates = array_unique($templates);
		sort($templates);

		return $templates;
	}

	function form( $instance ) {
		$instance = wp_parse_args($instance, array(
			'title' => '',
			'template' => 'loop.php',

			// Query args
			'post_type' => 'post',
			'posts_per_page' => '',
			'order' => 'DESC',
			'orderby' => 'date',

			'taxonomy'                 => 'category', // I've added this?!? thats my entire contribution here. 

			'sticky' => '',
			'additional' => '',
		));

		$templates = $this->get_loop_templates();
		if(empty($templates)) {
			?><p><?php _e("----", 'so-panels') ?></p><?php
			return;
		}

		// Get all the loop template files
		$post_types = get_post_types(array('public' => true));
		$post_types = array_values($post_types);
		$post_types = array_diff($post_types, array('attachment', 'revision', 'nav_menu_item'));

		?>
		<p>
			<label for="<?php echo $this->get_field_id( 'title' ) ?>"><?php _e( 'Title', 'so-panels' ) ?></label>
			<input class="widefat" name="<?php echo $this->get_field_name( 'title' ) ?>" id="<?php echo $this->get_field_id( 'title' ) ?>" value="<?php echo esc_attr( $instance['title'] ) ?>">
		</p>
		<p>
			<label for="<?php echo $this->get_field_id('template') ?>"><?php _e('Template', 'so-panels') ?></label>
			<select id="<?php echo $this->get_field_id( 'template' ) ?>" name="<?php echo $this->get_field_name( 'template' ) ?>">
				<?php foreach($templates as $template) : ?>
					<option value="<?php echo esc_attr($template) ?>" <?php selected($instance['template'], $template) ?>><?php echo esc_html($template) ?></option>
				<?php endforeach; ?>
			</select>
		</p>
		<p>
			<label for="<?php echo $this->get_field_id('post_type') ?>"><?php _e('Post Type', 'so-panels') ?></label>
			<select id="<?php echo $this->get_field_id( 'post_type' ) ?>" name="<?php echo $this->get_field_name( 'post_type' ) ?>" value="<?php echo esc_attr($instance['post_type']) ?>">
				<?php foreach($post_types as $type) : ?>
					<option value="<?php echo esc_attr($type) ?>" <?php selected($instance['post_type'], $type) ?>><?php echo esc_html($type) ?></option>
				<?php endforeach; ?>
			</select>
		</p>

		<p>
			<label for="<?php echo $this->get_field_id('posts_per_page') ?>"><?php _e('Posts Per Page', 'so-panels') ?></label>
			<input type="text" class="small-text" id="<?php echo $this->get_field_id( 'posts_per_page' ) ?>" name="<?php echo $this->get_field_name( 'posts_per_page' ) ?>" value="<?php echo esc_attr($instance['posts_per_page']) ?>" />
		</p>

		<p>
			<label <?php echo $this->get_field_id('orderby') ?>><?php _e('Order By', 'so-panels') ?></label>
			<select id="<?php echo $this->get_field_id( 'orderby' ) ?>" name="<?php echo $this->get_field_name( 'orderby' ) ?>" value="<?php echo esc_attr($instance['orderby']) ?>">
				<option value="none" <?php selected($instance['orderby'], 'none') ?>><?php esc_html_e('None', 'so-panels') ?></option>
				<option value="ID" <?php selected($instance['orderby'], 'ID') ?>><?php esc_html_e('Post ID', 'so-panels') ?></option>
				<option value="author" <?php selected($instance['orderby'], 'author') ?>><?php esc_html_e('Author', 'so-panels') ?></option>
				<option value="name" <?php selected($instance['orderby'], 'name') ?>><?php esc_html_e('Name', 'so-panels') ?></option>
				<option value="name" <?php selected($instance['orderby'], 'name') ?>><?php esc_html_e('Name', 'so-panels') ?></option>
				<option value="date" <?php selected($instance['orderby'], 'date') ?>><?php esc_html_e('Date', 'so-panels') ?></option>
				<option value="modified" <?php selected($instance['orderby'], 'modified') ?>><?php esc_html_e('Modified', 'so-panels') ?></option>
				<option value="parent" <?php selected($instance['orderby'], 'parent') ?>><?php esc_html_e('Parent', 'so-panels') ?></option>
				<option value="rand" <?php selected($instance['orderby'], 'rand') ?>><?php esc_html_e('Random', 'so-panels') ?></option>
				<option value="comment_count" <?php selected($instance['orderby'], 'comment_count') ?>><?php esc_html_e('Comment Count', 'so-panels') ?></option>
				<option value="menu_order" <?php selected($instance['orderby'], 'menu_order') ?>><?php esc_html_e('Menu Order', 'so-panels') ?></option>
				<option value="menu_order" <?php selected($instance['orderby'], 'menu_order') ?>><?php esc_html_e('Menu Order', 'so-panels') ?></option>
			</select>
		</p>

		<p>
			<label for="<?php echo $this->get_field_id('order') ?>"><?php _e('Order', 'so-panels') ?></label>
			<select id="<?php echo $this->get_field_id( 'order' ) ?>" name="<?php echo $this->get_field_name( 'order' ) ?>" value="<?php echo esc_attr($instance['order']) ?>">
				<option value="DESC" <?php selected($instance['order'], 'DESC') ?>><?php esc_html_e('Descending', 'so-panels') ?></option>
				<option value="ASC" <?php selected($instance['order'], 'ASC') ?>><?php esc_html_e('Ascending', 'so-panels') ?></option>
			</select>
		</p>

		<p>
			<label for="<?php echo $this->get_field_id('sticky') ?>"><?php _e('Sticky Posts', 'so-panels') ?></label>
			<select id="<?php echo $this->get_field_id( 'sticky' ) ?>" name="<?php echo $this->get_field_name( 'sticky' ) ?>" value="<?php echo esc_attr($instance['sticky']) ?>">
				<option value="" <?php selected($instance['sticky'], '') ?>><?php esc_html_e('Default', 'so-panels') ?></option>
				<option value="ignore" <?php selected($instance['sticky'], 'ignore') ?>><?php esc_html_e('Ignore Sticky', 'so-panels') ?></option>
				<option value="exclude" <?php selected($instance['sticky'], 'exclude') ?>><?php esc_html_e('Exclude Sticky', 'so-panels') ?></option>
				<option value="only" <?php selected($instance['sticky'], 'only') ?>><?php esc_html_e('Only Sticky', 'so-panels') ?></option>
			</select>
		</p>

		<p>
			<label for="<?php echo $this->get_field_id('additional') ?>"><?php _e('Additional ', 'so-panels') ?></label>
			<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'additional' ) ?>" name="<?php echo $this->get_field_name( 'additional' ) ?>" value="<?php echo esc_attr($instance['additional']) ?>" />
			<small><?php printf(__('Additional query arguments. See <a href="%s" target="_blank">query_posts</a>.', 'so-panels'), 'http://codex.wordpress.org/Function_Reference/query_posts') ?></small>
		</p>
	<?php
	}
}

Berg25 on "Submit button comment redirecting"

$
0
0

Hello anyone reading this and sorry if I'm posting in the wrong section.

I'm currently trying to build a website where the comments are all on 1 page.

The problem I'm having is after you submit a comment, the page goes to the page where the comment was posted. Is there anyway after you click the submit button the comment is just posted and nothing else happens?

I have been looking around but so far found nothing. If anyone can give me a hint or perhaps some help I would be very appreciative.

Thank you.


jalefkowit on "Overriding display_element in Walker class?"

$
0
0

In my process of learning how to work with the Walker class, I've come across a lot of online guides (including in generally high-quality venues like these forums and StackOverflow) that encourage overriding its display_element method. (Example, example, example, example.)

However, in the Codex's reference for the Walker class, when you look up the display_element method, it says (in bold, no less!):

This method should be considered private and should not be called directly.

I generally steer away hard from solutions that require making use of private/undocumented APIs, for the simple reason that such APIs tend to change with little or no warning, which can ruin your whole day. But I have yet to find any examples in this case of someone suggesting overriding this method and anyone responding that doing so is a terrible idea, despite what seems to be a very clear warning in the Codex.

So: I wanted to check in with the community to see if this is a case of a bad practice that's just gotten accepted by people, or if it's a case of something that used to be bad not being so bad anymore and the Codex just being out of sync with the Walker class as it currently works/exists.

Any thoughts?

queenielow on "Allow user to edit/view/create their own page only"

$
0
0

Hi There,

Is there a way without hacking the core to only allow user to edit/view and create their own page in the Dashboard, so they are not able to view other pages that is not created by them?

jnwry on "Add menus to admin using custom taxonomies"

$
0
0

Hello,

I'm developing a plugin for e-learning. It is laid out as courses->lessons+evaluations+final exam.

So I have figured out how to register_post_types as custom tipes (my_course) and add "lessons" (custom posts) to that post type. However, I am finding it hard to organize this way and would like to add a parent to each course (custom_post_type) by using custom taxonomies. How would I create an admin menu for each course_name using custom taxonomies and assign each custom_post_type specific to that course to that taxonomy?

Thanks in advance.

sicktb on "Add a comment field"

$
0
0

Dear all,

Im trying to ad a custom comment field that works the same as the "Message" field. I found all topics and tutorials. But my php skills are not realy updated.

What did i add? I put 'test'. This is how i now tryed to edit the comment-template.php

add_filter('comment_form_default_fields','add_comment_fields');

function comment_form( $args = array(), $post_id = null ) {
	if ( null === $post_id )
		$post_id = get_the_ID();
	else
		$id = $post_id;

	$commenter = wp_get_current_commenter();
	$user = wp_get_current_user();
	$user_identity = $user->exists() ? $user->display_name : '';

	if ( ! isset( $args['format'] ) )
		$args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml';

	$req      = get_option( 'require_name_email' );
	$aria_req = ( $req ? " aria-required='true'" : '' );
	$html5    = 'html5' === $args['format'];
	$fields   =  array(
		'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
		            '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
		'email'  => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
		            '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
		'url'    => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
		            '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',
	);

	$required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' );
	$defaults = array(
		'fields'               => apply_filters( 'comment_form_default_fields', $fields ),
		'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
		'test'			=> '<p class="comment-form-comment"><label for="test">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="test" cols="45" rows="8" aria-required="true"></textarea></p>',
		'must_log_in'          => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
		'logged_in_as'         => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
		'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>',
		'comment_notes_after'  => '<p class="form-allowed-tags">' . sprintf( __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s' ), ' <code>' . allowed_tags() . '</code>' ) . '</p>',
		'id_form'              => 'commentform',
		'id_submit'            => 'submit',
		'title_reply'          => __( 'Leave a Reply' ),
		'title_reply_to'       => __( 'Leave a Reply to %s' ),
		'cancel_reply_link'    => __( 'Cancel reply' ),
		'label_submit'         => __( 'Post Comment' ),
		'format'               => 'xhtml',
	);

And here i edit the 'test' in the comments.php from the theme

<?php $comment_args = array( 'title_reply'=>'Got Something To Say:',

'fields' => apply_filters( 'comment_form_default_fields', array(

'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Your Good Name' ) . '</label> ' . ( $req ? '<span>*</span>' : '' ) .

        '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',  

    'email'  => '<p class="comment-form-email">' .

                '<label for="email">' . __( 'Your Email Please' ) . '</label> ' .

                ( $req ? '<span>*</span>' : '' ) .

                '<input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' />'.'</p>',

    'url'    => '' ) ),

    'comment_field' => '<p>' .

                '<label for="comment">' . __( 'Let us know what you have to say:' ) . '</label>' .

                '<textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>' .

                '</p>',

    'comment_notes_after' => '',

        'test' => '<p>' .

                '<label for="test">' . __( 'Hoe maak je kaas?:' ) . '</label>' .

                '<textarea id="test" name="test" cols="45" rows="8" aria-required="true"></textarea>' .

                '</p>',

    'comment_notes_after' => '',

);

comment_form($comment_args); ?>

lyndonr on "Media Library View Defaults to "Uploaded to this post" Function"

normcaruso on "page database / portal"

$
0
0

Was curious if anyone knows of a way to create this functionality. I'm wondering if custom taxonomies will do it.

Basically I'm looking at adding a Games database to my website. Similar to what IGN does. (http://www.ign.com/games/duck-tales-next-gen/pc-20000236).

As you can see, they have like a "home page" for each game that contains information about the game along with links to all their articles / videos about the game.

Any thoughts / ideas? Thanks!

cyarema on "Geolocation Redirect"

$
0
0

**Note, tried to put this in WP-Advanced, but couldn't post there**
A previous programmer at my company did this coding to detect user location (on mobile) and direct them to the nearest pharmacy (there are only 4):

http://pastebin.com/v4Qbw6eL

I have the header, function, and archive page code in pastebin

However it stopped working. I don't know if it's due to the outdated where.yahoo since that changed to boss. But I don't know how to fix it. I've searched the internet far and wide and can't seem to figure out how to redirect the users and this previous code seems like it would do the trick.

Any help or solutions would be amazing since I'm supposed to have this done by the end of the week.


StashCat on "Post (on BuddyPress) with Java"

$
0
0

Hey guys, I'm fairly new to the WordPress forums. Anyways, I need to check and post status updates, etc. on BuddyPress through Java. I'm not too familiar with these things, so please give me the mostly-throughout explanation with an example. Thanks!

jhuston1989 on "Pluggable.php Permissions Being Changed -> Crash"

$
0
0

I am having a problem where the pluggable.php permissions are being changed from read/write to read only sporadically.

I am asuming this is some sort of hack as the website is running fine with no changes being made and then crashes and an error message is displayed that it cannot access pluggable.php

All functionality is restored when the permissions are reverted, but it happens again a month or so later.

czetzl on "Daily Subscription Email Spam"

$
0
0

About a week ago, we notice spam going out in our blog's daily subscription email. The email is automatically generated, we're not sure using which plugin.

After doing a security scan in Go Daddy, we uncovered quite a few vulnerabilities including:

The remote web server is affected by an information disclosure vulnerability
Status: Not yet addressed
Port: https (443/tcp)

The remote web server is affected by an information disclosure vulnerability
Status: Not yet addressed
Port: http (80/tcp)

External links were discovered on your website.
Status: Not yet addressed
Port: http (80/tcp)

Some cgis are candidate for extended injection tests.
Status: Not yet addressed
Port: http (80/tcp)

Site Scanner is unable to process scans for your site.
Status: Not yet addressed
Port: http (80/tcp)

Site Scanner is unable to resolve your site.
Status: Not yet addressed
Port: http (80/tcp)

This plugin determines which HTTP methods are allowed on various cgi...
Status: Not yet addressed
Port: http (80/tcp)
WordPress® is installed on your Web server.
Status: Not yet addressed
Port: http (80/tcp)

Your Web server contains directories that are identifiable to visitors.
Status: Not yet addressed
Port: http (80/tcp)

Your Web server contains directories that are identifiable to visitors.
Status: Not yet addressed
Port: https (443/tcp)

Your Web server contains office-related files.
Status: Not yet addressed
Port: http (80/tcp)

Your website uses HTTP cookies.

How can we resolve this?

David Hunt on "How to add access keys to wp_nav_menu"

$
0
0

I'm not sure if this is the right place for this, but I thought I'd share the relatively painless way I came up with to add access key attributes to the output of wp_nav_menu(), for improved website accessibility.

The basic concept is:

  • Use the XFN attribute to define the access key for each desired menu item (so this assumes the XFN field is unused)
  • Use a custom walker to grab the XFN value and assign it to the accesskey attribute.

So in your functions.php you need a nearly-identical version of the standard nav menu walker:

class My_Walker extends Walker_Nav_Menu {
	function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
		global $wp_query;
		$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';

		$class_names = $value = '';

		$classes = empty( $item->classes ) ? array() : (array) $item->classes;
		$classes[] = 'menu-item-' . $item->ID;

		$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
		$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';

		$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
		$id = $id ? ' id="' . esc_attr( $id ) . '"' : '';

		$output .= $indent . '<li' . $id . $value . $class_names .'>';

		$attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';
		$attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';
		$attributes .= ! empty( $item->xfn )        ? ' accesskey="'    . esc_attr( $item->xfn        ) .'"' : '';
		$attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';

		$item_output = $args->before;
		$item_output .= '<a'. $attributes .'>';
		$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
		$item_output .= '</a>';
		$item_output .= $args->after;

		$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
	}
}

The only difference is that instead of rel we have accesskey.

Then to use the custom walker with wp_nav_menu(), you need to do as follows:

$walker = new My_Walker;
wp_nav_menu( array( 'walker' => $walker ) );

(You can, of course, add whatever other arguments you want to the array.)

Now in the Appearance Menus Screen, make sure the XFN attribute is visible by checking the box in Screen Options. Then for whatever menu items you want to have an access key, just add the key value to the XFN field.

While there are no agreed standards for access keys, the UK Government suggests the following:

  • S - Skip navigation
  • 1 - Home page
  • 2 - What's new
  • 3 - Site map
  • 4 - Search
  • 5 - Frequently Asked Questions (FAQ)
  • 6 - Help
  • 7 - Complaints procedure
  • 8 - Terms and conditions
  • 9 - Feedback form
  • 0 - Access key details

Further reading:

  • Wikipedia page describes how to use access keys in various browsers.

I'd be keen to hear if anyone has any suggestions of how to improve on this. (Being able to add a genuine accesskey field to the Appearance Menus, rather than hijacking the XFN field, would be good.)

kmack176 on "Keep admin header/menus from refreshing??"

$
0
0

Hey guys, I'm new to this forum and couldn't find an answer to this anywhere. I am trying to design a customized CMS based off of wp and am pretty happy with the results. However, I would really like to keep the admin header and menu static when clients are switching pages. For example, when the client goes from dashboard to media, I would like only the content area to refresh and the header and menu to remain on the page.

I'm assuming this would be way more involved than I am willing to myself into, but was wondering if someone had a somewhat easy solution. Thanks.

Viewing all 8245 articles
Browse latest View live




Latest Images