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

lizmcreations on "Show excerpt instead of "description" in hover"

$
0
0

I am using Event Calendar WD for events - but each event is actually a "product" from Marketpress so that people can purchase a ticket for the class/register.

So, the "description" of the event/event details are generated by a shortcode --- when you view the actual event, the shortcode runs and the content comes through --- but when you are in the calendar view and you hover on the event it doesn't process the shortcode, it just shows the shortcode.

Unfortunately, I am at a loss for how to fix this ... I've activated "excerpts" on the event post type - so that I could create an excerpt for the event. Then, I was thinking I would need to set the events calendar to show the excerpt in the hover -- but I'm not sure where to do that.

I also considered to have the shortcodes process in the hover -- but again, I'm not sure how to do that either ...

Site: http://artscentereast.org/what-we-offer/classes/ --- go to August to view a class ....

Any help/tips of what to look for in the events calendar code would be so appreciated.

Thank you!!!

Elizabeth Martinez


Harsh Agrawal on "Using Custom Database for WordPress login"

$
0
0

** Single login for WordPress, Mobile App**

Hey Guys
I have a WordPress blog & have an Android & iOS App for the blog. Now I need to add My account feature into the app & wondering what's the best way to get it done which doesn't affect my future plans.

I Plan to use a custom database for user management for my iOS app & Android app (For the same blog). Here is the question & any kind of your advice would be appreciated:

Can I use custom database for user management of my WordPress blog.
If not, can I sync user table to & fro from custom database to existing WordPress database & vice-versa.

I need Single sign-on for all the platform (I also have a discourse forum) & if you can point me to right direction, it would be of great help.

bigabig on "Show Recent Posts Widget"

$
0
0

Hey guys,
I want to develop a widget that shows the most recent posts.
For some reason the following code doesn't format the post content... (The post content is displayed without any formatting like <p></p> or
etc.)

/**
     * Outputs the HTML for this widget.
     *
     * @param array  An array of standard parameters for widgets in this theme
     * @param array  An array of settings for this widget instance
     * @return void Echoes it's output
     **/
    public function widget( $args, $instance )
    {
        // Add any html to output the image in the $instance array´

		$count = (!empty( $new_instance['count'] )) ? $new_instance['count'] : 1;

		$args2 = array(
			'numberposts' => $count,
			'orderby' => 'post_date',
			'order' => 'DESC',
			'post_type' => 'post',
			'post_status' => 'draft, publish, future, pending, private',
			'suppress_filters' => false );

		$recent_posts = wp_get_recent_posts( $args2, OBJECT );

		foreach( $recent_posts as $recent ){
		?>
			<h1><?php echo $recent->post_title ?></h1>
			<div class='entry-content'>
			<p>
			<span class="entry-date"><?php echo get_the_date("F Y", $recent->id); ?></span><br/>
			<?php echo $recent->post_content;  ?>
			</p>
			</div>
		<?php
		}
    }

Can someone help me?

Tche111 on "How to change a custom field into a dropdown list?"

$
0
0

Hi,
I have added a title and a 'category' field to my comment form but now I d like to change the category field in a dropdown list. How should I adapt the following code?

/// Add and record metadata to comment
//Add fields
add_action( 'comment_form_logged_in_after', 'additional_fields' );
add_action( 'comment_form_after_fields', 'additional_fields' );

function additional_fields () {
  echo '<p class="comment-form-title">'.
  '<label for="title">' . __( 'Titre (Je peux...)' ) . '</label>'.
  '<input id="title" name="title" type="text" size="30"  tabindex="5" /></p>';

  echo '<p class="comment-form-cat">'.
  '<label for="category">' . __( 'Catégorie (Dans tous les cas, sans argent, sans le temps...)' ) . '</label>'.
  '<input id="category" name="category" type="text" size="30"  tabindex="5" /></p>';
}

// Record both
add_action( 'comment_post', 'save_comment_meta_data' );

function save_comment_meta_data( $comment_id ) {
  if ( ( isset( $_POST['title'] ) ) && ( $_POST['title'] != '') )
  $title = wp_filter_nohtml_kses($_POST['title']);
  add_comment_meta( $comment_id, 'title', $title );

  if ( ( isset( $_POST['category'] ) ) && ( $_POST['category'] != '') )
  $category = wp_filter_nohtml_kses($_POST['category']);
  add_comment_meta( $comment_id, 'category', $category );

}

Would anybody have an idea on how to change it?
Many thanks in advance for your help!!!
Hopefully,

Thierry

Nex44 on "Trigger when image from editor is removed"

$
0
0

Hi there,

i really hope anybody here can solve my problem.

I have a filter which adds a noscript-tag after every image-tag. The image-src will changed by javascript to set the optimal image for mobile and not mobile devices. So need the noscript-tag as fallback option.

So when a user delete an image at the editor, the noscript-tag must be also removed like the image-tag. Is there any existing event to use? The click function have to been replaced by an event which is triggered when a image will be remove.

Any solutions/tipps?

var iframe = $('#content_ifr').contents();
		 	//when image is removed then delete noscript-tag
			iframe.find(".wp-image-880").click(function(){

				   alert('Image is removed from Dom');
				   if(iframe.find(".wp-image-880").next("noscript") != null)
				   {
					    iframe.find(".wp-image-880").next("noscript").remove();
				   }
			});

Please let me know if anybody as idea to solve this problem. Thanks

CCM_WordPress on "Question about potential hacks"

$
0
0

I have a website which is hosted by a third party provider, I have access to the WordPress admin panel and need to request FTP details from my third party.

On several occasions I have received alerts from Webmaster Tools to say the site has been compromised. When this happens and I log in to the WP admin panel I can see now additional pages or posts.

When I log in through through the FTP I see new folders have appeared in the root directory named something like "hknofjd". My question is, could these folders have been created by a hack through the WordPress admin panel or one of the plugins or is this a "server" hack?

Md. Alimuzzaman Alim on "early bypass filter for wp_get_object_terms();"

$
0
0

Get early bypass filter like get_metadta() for wp_get_object_terms();
I want to generate tarms on run-time.
meta.php:480:

$check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single );
    if ( null !== $check ) {
        if ( $single && is_array( $check ) )
            return $check[0];
        else
            return $check;
    }

plugza on "Populate multiple dropdowns"

$
0
0

It's a bit complicated here. But I'm in real trouble right now.

Let me explain
I want 3 dropdowns populate by order.
unless the first it will be disabled.
- product year (product custom taxonomy)
x product brand (product custom taxonomy)
x product title (product custom post type)

* x means disabled at start.

Select the first one will enable the second one and populate taxonomy of product that have slug from the first taxonomy.

Then select the second one will enable the third one and populate products' title. (this stage means you will get a product that have two taxonomies related)

Then select the third one will get product value inside "in the same page"

I just want some keywords from the third one's contents to do something next.

How can I accomplish this?
Any help would be much appreciated


petron99 on "Need help with RewriteRule - want to pass part of url as parameter"

$
0
0

Hope this belongs here. Need help with my htaccess code.

I want to turn these URLS:
/mysite/site1/offer/
/mysite/site2/offer/
/mysite/site1/offer/?name=tom&email=test@test.com

into to this:
/mysite/site1/?page=offer
/mysite/site2/?page=offer
/mysite/site1/?page=offer&name=tom&email=test@test.com

So that wordpress ignores '/offer/' and instead passes the url parameter to the custom template.

Can this be done?

I tried this:
RewriteRule /mysite/([^/]+)/([^/]+)/$ /mysite/$1/?pg=$2 [L,QSA,NC]

But I know it's missing the bit to capture the other url params but not sure how to write this.

Any help is greatly appreciated. Thanks!

unikbit on "how to add a text box on home page"

$
0
0

how to add a text box on home page, other then the tagline? Lets say under the services area. The text box can be same as tagline.

Thx

Badeyes on "If statements and using get_theme_mod"

$
0
0

Hi all

I'm trying to modify the following if statement with the output from the get_theme_mod but having no luck, the current one I'm using is:

<?php if( $thePriority_settings['social_title'] != '' ) : ?>
<?php
echo $thePriority_settings['socialTitle'];
?>
<?php endif; ?>

how do I change it to look for the control output socialTitle in my customizer?

cheers

Geof

lunacodes on "Custom Single Post Type not referring to single-post-type.php File"

$
0
0

I've defined a Custom Post type called "Press", I'm trying to modify the Single Posts template for that Custom Type. The single posts custom file is called "single-press.php"

I've tried using an if in_category(cat_number), get_template_part type statement in single.php & it seems to give me a White Screen rather than the page ...

This is the code I'm currently attempting in my single.php file:

<?php get_header(); ?>

<div class="row">
    <div class="col-sm-12">
        <?php get_sidebar(); ?>
    </div>
</div>

<?php if in_category( $category, $_post )  {
    echo('Category')
}
?>

<div class="row">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

        <div class="col-sm-8 col-sm-offset-2">
        <article <?php post_class() ?> id="post-<?php the_ID(); ?>">
            <?php   if(has_post_thumbnail()){
                the_post_thumbnail('large');
            };
            ?>

            <h1 class="single-entry-title"><?php the_title(); ?></h1>
            <h2 class="subhead"><?php the_field('subhead'); ?></h2>
            <?php include (TEMPLATEPATH . '/meta.php' ); ?>

            <div class="entry-content">
                <?php the_content(); ?>
            </div>

        </article>

    <?php endwhile; endif; ?>

    </div>

</div>

<div class="row">
    <div class="col-sm-12">
        <?php related_posts() ?>
    </div>
</div>

<?php get_footer(); ?>

Does anyone have some suggestions as to what might be going wrong, or how to get the Single "Press" posts to follow what's in single-press.php ??

theplastickid on "Assigning an image to dated archives"

$
0
0

On my website I have a bunch of articles published on different dates, just like a standard blog.

In the sidebar I am using the standard "archives" widget to list all of the months, users can then click on the month and see posts only from that month.

What I would like to achieve is to be able to display all of the links to the months on a single page rather than in the sidebar, but more importantly with an image associated to them.

I am not talking about creating a custom archive and assigning an image to that, I want to assign an image to the default date/month that WordPress already generates and sorts by.

Does anyone know of a solution to this? Perhaps you could point me towards some resources to implement.

Many Thanks,
Brett.

Cory on "wp_set_object_terms Not Working With Custom Taxonomy"

$
0
0

Having some trouble with a front-end posting form. I can't for sure link it to the most recent upgrade, but suddenly wp_set_object_terms will not assign a custom taxonomy to a post (either to a native post, or to a custom post type).

I can get it to add a category to a native post like this:

wp_set_object_terms ( $id, $term, 'category' );

But when I try it with a custom taxonomy, e.g.,

wp_set_object_terms ( $id, $term, 'customtaxonomy' );

It doesn't work. The weird thing is it was working several weeks ago.
It if matters, my custom taxonomies and post types are created using Types.

Tche111 on "Add 1 meta to comments // Show comments by that meta"

$
0
0

Hi everybody,
On our website (allwewish.org), we are gathering wishes and solutions; Since 2009, I set the solutions that I receive by comments or emails or that I find on the web in the post (1post = 1wish) they relate to.
Today I am analysing the possibility of using the comments tool as a direct solution feed. I have already managed to add a title to the comment and to show that title in wp_comment_list but to go further in the integration I would need your advise and help:

1. To add a new meta that would look like a sort of category for the solutions proposed (example: lack of money, lack of time, lack of health or in any case)
This doesnt look to difficult to me as I think I could basically apply the same solution than the one I use to give a title to the comments.
I would just need to settle the 4 categories allowed as in a droplist as explained in the following tutorial:
http://www.bobz.co/dynamically-populate-select-fields-choice-in-advanced-custom-fields/

2. To show the new comments below the post according to their "category"
Either with each category shown as a tab on which the reader should click to see the relevant solutions
Or with all the comments shown in a list, classified per "category" with each category shown as the title of its group...

Have you ever done something similar? Would you happen to have a solution or a tutorial to manage the 2nd issue?
(I have looked on the web a lot without success but maybe using wrong keywords)

Many thanks in advance for your help!
Wishing you a nice day


tamilvananmt on "Website is redirecting to other site"

$
0
0

Hi,
My website(http://www.megrontech.co.uk) ,but it is redirecting to other site(www.vipmkbags.com).If you enter url in browser its working.But if you do google,bing or yahoo search, it redirects to other site(www.vipmkbags.com)
I am struggling to fix this issue since last week.Please help me.
I checked with my webhost provider they are saying ,you site is not hacked,google database is not updated .I checked all files in my ftp server,there is no malware code.

cartns on "Comment Moderation Panel in wp-admin"

$
0
0

Hello,

I want only zero approved comments have posts in the pending section.

How can I do this? thank you very much.

devkn on "automagically adding custom fields to post content in hidden div"

$
0
0

This might sound a little crazy but it would work as a very elegant solution for a particular project.

I have a client, with a bunch of different post types. One of them is 'coaches'. They want the 'coaches' search to have a lot of functionality, and I've delivered almost all of it, except for one thing: they want the keyword search field to search all the custom fields and taxonomies as well as the content and title of the post. As far as I know, this can't really be done without quite a bit of hack, then slash, hacking (maybe I'm wrong? All the searching I've done has told me that's true). But as I prodded along this problem, I realized, that for what they want, if I just added all of the custom fields (the ones that apply at least) and taxonomies into the post itself, in a div I could hide with css, the keyword search would do exactly what they want, and do it logically. It's a quick and dirty tag search, I guess, but it seems like the right thing (then again, maybe I'm nuts, being as I've been up all night working on this project, and have had to do a so a few times this week for different deadlines).

What I'm wondering is twofold:
#1 am I bonkers? Is this a really wacky way to accomplish this?
#2 if not, before I write a pluging to do it myself, has someone already done this (might as well not reinvent the wheel).

Thanks.

thomas_ac on "Security Concerns with Front End Filters for Posts"

$
0
0

Hi Guys,

i posted this thread on the troubleshoot forum. I figured, this topic fits here best. Here is my issue:

i am looking to create multiple front end filters, for users to sort and filter through posts. I have created multiple custom taxonomies, which i would like to use for this matter. Very similirar to how you would sort through products in an e-commerce store.

I have found this blog post, that has tipped me into the right direction on how to tackle this, but i have come across some concerns.

If i use URL parameters to apply values to filter the query, how do i make sure i dont pick up some nasty scrips or code through the URL? Is there some WP core function that handles injections?

Is using URL parameters a viable approach to this issue in the first place? Are there any other best practice methods on resolving this?

I have looked into a couple of plug-ins on this topic that offer short code search forms, but none meet the implementation needs in order for me to create a userfriendly search form the way i want it. Anyhow, i am very open to plug-in suggestions as well.

Update
I also found this post, that pretty much sums up my concerns.

http://www.joellipman.com/articles/web-development/503-basic-tests-for-sql-injection-vulnerabilities.html

I would want to avaoid going through all that processing for each parameter value. How does WP handle input provided by the search form? Is there some third party framework, that i could use?

---
Help much appreciated.
Thomas

daniel on "remove `says` text in default wp_list_comments"

Viewing all 8245 articles
Browse latest View live




Latest Images