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

wp system questions on "How do i edit the system generated comment moderation messages without a plugin."

$
0
0

How do i edit the system generated comment moderation messages without a plugin. What file in the wordpress system would i edit.


rogty on "create my own javascript library"

$
0
0

Hello,
I would like to create my library of Javascript functions and use it in my file myjsfile.js but the functions defined in mylibrary.js are not recognized in myjsfile.js

function mylib_enqueue_scripts() {
		wp_enqueue_script( 'jquery' );

 wp_enqueue_script( 'LIB1', '/JS/mylibrary.js' );
		wp_register_script( ‘myjsfile’, '/JS/myjsfile.js',array(LIB1'));

		 wp_enqueue_script(‘myjsfile’);
	 }
	add_action( 'wp_enqueue_scripts', 'mylib_enqueue_scripts' );

What can I do ?
Thank you

mase857 on "Flexsider sometimes works and other times doesn't work on Wordpress ??"

$
0
0

So I have an insane bug here , the flexslider effect works sometimes and other times doesn't work and now it doesn't seem to work most of the times .. I can't seem to detect what's causing the error .. Your support would be greatly appreciated .

this is what I get in the javascript console , the site is http://irvinevetservices.com/

GET http://ad4.liverail.com/rt/?n=_search_magnetic_natgeo_wild&h=24 404 (Not Found) f:14
Uncaught TypeError: Object [object Object] has no method 'flexslider' (index):704
Resource interpreted as Image but transferred with MIME type text/html: "http://d.agkn.com/iframe/3957/?sp=585&che=-638126717&partner_id=89e15dc2-dfaf-4166-b4e3-ac6500e3b9b3". rt=ifr:3

pyroevil on "How to edit content of category page"

$
0
0

Hi,

I use wordpress 3.8.1 with the theme tweenty fourteen. Unfortunetly , when you click on a category with no post assigned to it for now , it's display a "not found" page. I try to make a plugins with hook that replace that by a text ( like the description of the category ). If no post is in the category , only description is displayed , if category have post , description is displayed and posts founds after.

Mohit Kumar on "Existing Ecommerce plugins with Custom Post Types"

$
0
0

Hi Experts,

I am developing a solution which is selling a service (can not be categorized as product) I have developed custom post types and taxonomies but I do not want to re-invent the wheel by adding payment gateways just for this purpose. Is there any way I can customize the "Product" post type in the existing ecommerce plugin.
I have checked documentation of woo-commerce and I think it is not possible,

Thanks for your support

Liltiger on "How To Hide Edit Fields From Non-Admins"

$
0
0

Hey There,

I need to hide some field options in the edit post template.

I've modified this code in wp-admin/edit-form-advanced.php

if ( current_user_can( 'manage_options' ) ) {
        return;
if ( $theme_support || $audio_post_support || $video_post_support )
	add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');

if ( post_type_supports($post_type, 'excerpt') )
	add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core');

if ( post_type_supports($post_type, 'trackbacks') )
	add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', null, 'normal', 'core');

if ( post_type_supports($post_type, 'custom-fields') )
	add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', null, 'normal', 'core');
}

It works pefect when an author is editing a post, but it doesn't work for the admin. All I get is this:

"Thank you for creating with WordPress.
Version 3.8.1
This content is currently locked. If you take over, username will be blocked from continuing to edit.
Listings Preview Take over
The backup of this post in your browser is different from the version below. Restore the backup.
Post restored successfully. Undo."

I'm not proficient w/ PHP at all. I can handle snips here and there so any help would be greatly appreciated!

jonsp on "redirect /wp-admin/index.php to /wp-admin/profile.php"

$
0
0

I'd like to have a site set up so people can register as subscribers, after which point I'd want them only to be able to access their profile on the backend and then the full front end site.

I'm having trouble at the moment figuring out how to keep them from being able to access /wp-admin/index.php (the dashboard) after they've logged in. They are taken automatically to their profile since they are subscribers, but they can access index.php, so this isn't urgent but I'd like it to be clean.

I tried the following with no results

function logged_in_home_redirect() {
    if( ($current_url = home_url( '/wp-admin/index.php' )) && !($current_url = home_url( '/wp-admin/profile.php' ))) {
        wp_redirect( home_url( '/wp-admin/profile.php' ) );
        exit;
    }
}

if (!current_user_can('administrator')) :
add_action( 'init' , 'logged_in_home_redirect' );
endif;

I'm looking for something quick and effective to plop into my functions.php file. Thanks in advance for any assistance that can be offered.

golazo on "Frontend upload"

$
0
0

Hi,

How can create image uploader for my custom frontend form?

I have this line in my custom-page.php <input type="file"/> and i want by this input to add image and show in specific post id.

Please help if you can. Any way you can. Thx!


wp system questions on "Within the wordpress system, what file generates this exact moderation message??"

$
0
0

Basically, my only question is, within the wordpress system, what file generates this exact moderation email?
________

A new comment on the post "Licensing" is waiting for your approval http://mydomain.name/licensing/

Author : Frank Rizzo (IP: 123.456.789.21 , 123.456.789.21) E-mail : my@email.com
URL : http://www.abc.com
Whois : http://whois.arin.net/rest/ip/123.456.789.21
Comment:
testnow

Approve it: http://mydomain.name/wp-admin/comment.php?action=approve&c=2
Trash it: http://mydomain.name/wp-admin/comment.php?action=trash&c=2
Spam it: http://mydomain.name/wp-admin/comment.php?action=spam&c=2
Currently 1 comment is waiting for approval. Please visit the moderation panel:
http://mydomain.name/wp-admin/edit-comments.php?comment_status=moderated

jimbobjonez on "wordfence scan critical error"

kowsar89 on "running shortcode inside AJAX request"

$
0
0

I know that running shortcode inside AJAX isn't possible, because AJAX requests are always admin requests. But is there any other way to make it possible? Like by loading some files by force eg. shortcodes.php

jerryskate on "Make background div push post content down"

$
0
0

I wonder if it would be possible to make superzised push down the main container so content will be hidden? Tried fiddling with z-index but no luck. This is my testsite: http://www.svenssonsbild.se/Baronen/?page_id=103

I would like to place the video and anything else posted below the background image. I got the page to fill just the browsersize regardless of height, so now i need to place the maincontainer below the background.

afifnajib on "Adding category - AJAX interrupted"

$
0
0

Hello everyone.

I have a plugin called "Basic Google Maps Placemark" installed, and it uses a custom taxonomy called bgmp-category. What am I trying to do now, is whenever the user creates a new Posts category, a new bgmp-category taxonomy is automatically created.

This has done the job:

add_action( 'created_category',			array( $this, 'autoAddCategory' ) );

public function autoAddCategory($term, $taxonomy, $args = array()) {
	$addedTerm = get_term($term, 'category');
	return wp_insert_term($addedTerm->name, self::TAXONOMY, array('description' => $addedTerm->description, 'slug'=> $addedTerm->slug));
}

Unfortunately, now whenever I create a Posts category, the newly-created category does not show up on the list until I hit refresh, which means the AJAX somehow got interrupted because of my action hook.

What should I do?

coldpumpkin on "Change generated HTML code from "Add Media" button"

$
0
0

Hello there.

When we're inserting an image to a post, by clicking the "Add Media" button, WordPress generates a certain code, being:

<a href="image_url"><img src="image_url" alt="image_name" width="image_width" height="image_height" class="image_class" /></a>

Question here is - how to change the way the code is generated? What if I want to add attributes to the <a> tag? And what if I don't want some of those attributes of the <img> tag?

Thanks in advance for your answers!

marathonmilk on "Display slideshow, if not display featured image."

$
0
0

Hi there

I'm using a slideshow plugin which generates a slideshow and outputs a shortcode to use it in the theme or post. I've added a custom field to posts where that shortcode can go.

What I'd like is for the theme to check if there's a short code there, and if there is to display it, if not, check it there's a featured image for the post and display that, and if there's no short code and no featured image to do nothing. Does that make sense?

Having a bit of trouble with it, so if anyone's able to help that would be much appreciated.

Thanks!
Mark

Note: reposting this as I got the original forum wrong.


DuendeB25 on "¿Como ejecutar script en ciertas paginas de wordpress? How to execute script in"

$
0
0

Hi everyone I run a javascript script on several pages but not all, is that there wp_enqueue_script function but not know how to do and where I need to insert. I've tried several codes but do not realize what I want and is only running on various pages. If someone is kind enough to help me understand here I leave a link to the information I found and further down the code I use. Thanks for reading.

http://www.masquewordpress.com/como-incluir-scripts-en-paginas-wordpress/

function imageAleatoria(){
if(is_page('http://localhost/wordpress/wp-content/?=79')) wp_enqueue_script('imagen','/http://localhost/wordpress/wp-content/js/imagenesAleatorias.js));
}
add_action('imagen','imageAleatoria');

Center11Forward on "Change 'view post' button text and confirmation text"

$
0
0

Hi, I am working with a custom post type and I would like to change the text on some Wordpress buttons to suit that type...

A. How would I go about changing the button text 'view post' to something else?
B. When you update/edit a post, a message pops up saying 'Post updated. View post'. How could I change that to something else?

Thanks.

2005casemore on "Installing Installation Code For A Web Form"

$
0
0

I have a web form to put on my site and I have the HTML code to install it. How do I do this

Chris Simmons on "Plugin version wont update on wordpress"

$
0
0

For some reason the current version of my plugin wont update on wordpress. I have tried creating new tags and changing the stable version in the trunk readme but nothing seems to work. Has anyone ever run into this?

https://wordpress.org/plugins/wp-backitup/

Thanks in advance for any help.

alysiacaringi on "Move comment input box above comments"

$
0
0

Can anyone tell me how to move my comments input form above the comments?

here's my code:

<?php
// Comments template for pages

// Prevent Comments page from being accessed directly
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not load this page directly. Thank You!');

// Prevent Comments page from being displayed if password protected
if ( post_password_required() ) { ?> <p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.','truethemes_localize');//@since 3.0.3, made this translatable ?></p>
<?php return; }

// Get page comments status from custom metabox
global $post;
$page_comments_status = get_post_meta($post->ID,'page_comments',true); 

// Formatted Comments Function
function Karma_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>

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

<div class="comment-wrap">

  <div class="comment-content" id="comment-<?php comment_ID(); ?>">
  	<div class="comment-gravatar">
  	<?php
  	//@since 3.0.3 modified by denzel to allow WordPress default gravatars
  	global $ttso;
    $default_avatar_setting = $ttso->ka_default_avatar;
    if(empty($default_avatar_setting) || $default_avatar_setting == 'true'):
  		echo get_avatar($comment,$size='60',$default=get_template_directory_uri().'/images/_global/default-grav.jpg' );
  	else:
  		echo get_avatar($comment,$size='60');
  	endif;
  	?>
  	</div><!-- END comment-gravatar -->

  	<div class="comment-text">
	<span class="comment-author"><?php comment_author_link() ?></span> &nbsp;<span class="comment-date"><?php comment_date('F j, Y'); ?></span><br />
	<?php if ($comment->comment_approved == '0') : ?><?php _e('Your comment is awaiting moderation.','truethemes_localize') ?><?php endif; ?>
	<?php comment_text() ?>
	<?php comment_reply_link(array_merge( $args, array('reply_text' => __("reply","truethemes_localize"), 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>  <?php edit_comment_link(__('edit','truethemes_localize'),' ','') ?><?php
if(function_exists('like_counter_c')) { like_counter_c('Like'); }
?>
    </div><!-- END comment-text -->
  </div><!-- END comment-content -->
</div><!-- END comment-wrap -->

<?php }

function list_pings($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>

<li>
<span class="comment-author"><?php comment_author_link() ?></span> &nbsp;<span class="comment-date"><?php comment_date('F j, Y'); ?></span><br />
<?php }

// If user turns on comments -> display them
if ('on' == $page_comments_status) :

if (have_comments()) :
$comment_count = count($comments_by_type['comment']);
($comment_count !== 1) ? $comment_txt = __('Comments','truethemes_localize') : $comment_txt = __('Comment','truethemes_localize');
$trackback_count = count($comments_by_type['pings']);
($comment_count !== 1) ? $comment_txt_trackback = __('Trackbacks','truethemes_localize') : $comment_txt_trackback = __('Trackback','truethemes_localize'); ?>

<div class="tabs-area" id="blog-tabs">
	<h2><i class="fa fa-comments-o discussion-title"></i><?php _e('Comments','truethemes_localize'); ?></h2>

		<ul class="tabset">
			<li>
            <a href="#tab-0" class="tab"><span><?php echo "<strong>".$comment_count."</strong> &nbsp;".$comment_txt; ?></span></a>
            </li>
			<li>
            <a href="#tab-1" class="tab"><span><?php echo "<strong>".$trackback_count."</strong> &nbsp;".$comment_txt_trackback; ?></span></a>
            </li>
		</ul>

		<div id="tab-0" class="blog-tab-box">
			<?php if ( ! empty($comments_by_type['comment']) ) : ?>
            	<ol class="comment-ol" id="post-comments">
					<?php wp_list_comments('callback=Karma_comments&type=comment'); ?>
                </ol>

<!-- BEGIN COMMENTS PAGINATION -->
<div id="comments">
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-below">
<div class="nav-next"><?php paginate_comments_links(); ?></div>
</nav>
<?php endif; // check for comment navigation ?>
</div>
<!-- END COMMENT PAGINATION -->

<?php endif; //end have_comments()
endif; //end have_comments() ?>

<div id="respond">

<?php if ( get_option('comment_registration') && !$user_ID) : ?>
<p>You must be<a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>"> logged in</a> to post a comment.</p>
<?php else : ?>

<?php
//since version 3.0
//use WordPress comment_form function
//filtering of inputs are in framework/theme-functions.php

$defaults = array(
		'fields'               => apply_filters( 'comment_form_default_fields', $fields ),
		'comment_field'        => '<p class="comment-textarea-wrap"><label  class="comment-label" for="comment">' . __( 'Your Comments','truethemes_localize' ) . '</label><textarea name="comment" class="comment-textarea" tabindex="4" rows="5" cols="5" id="comment" 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>',

		//use admin_url('profile.php') instead of get_edit_user_link() which is WP 3.5 function.
		'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>' ),  admin_url('profile.php'), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
		'comment_notes_before' => '',
		'comment_notes_after'  => '',
		'id_form'              => 'commentform',
		'id_submit'            => 'ka-comment-form-submit',
		'title_reply'          =>   '<h6 class="heading-horizontal tt-blog-related-post"><span><i class="fa fa-pencil-square-o" style="font-size:13px"></i>&nbsp;'.__( 'Add a Comment','truethemes_localize' ).'</span></h6>',
		'title_reply_to'       => __( 'Leave a Reply to %s','truethemes_localize' ),
		'cancel_reply_link'    => '<div class="comment-cancel">'.__( 'click here to cancel reply','truethemes_localize' ).'</div>',
		'label_submit'         => __( 'Add Comment','truethemes_localize' ),
	);

comment_form($defaults); 

?>

<?php endif; ?>
</div><!--end comment-response-->
<?php endif; ?>

<?php // Output Trackbacks
if (have_comments()) : ?>
</div>
<div id="tab-1" class="blog-tab-box">
<?php if ( ! empty($comments_by_type['pings']) ) : ?>
<ol class="commentlist">
<?php wp_list_comments('callback=list_pings&type=pings'); ?>
</ol>
<?php endif; ?>
</div>
</div>
<?php else : if ('open' == $post->comment_status) : else : endif; endif; ?>

I tried moving the respond div above

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

but and that moves it up but it will only appear if there are comments. If there are no comments the comment form doesn't show up at all.

Suggestions?

Viewing all 8245 articles
Browse latest View live




Latest Images