Tag Info

New answers tagged

0

The Vimeography Developer Bundle for the Vimeography plugin includes a gallery theme that does just what you are looking for - it is called "Single" and can only be found in the Bundle. Hope this helps!


0

that worked out but i had to find another way because if someone else has to use the theme, his/her id for that category might not correspond to mine. Here's the soultuion i found: code function my_list_edd_terms() { $theCatId = get_term_by( 'slug', 'HorrorBooks', 'download_category' ); $theCatId = $theCatId->term_id; $taxonomy = ...


0

Yes, you can load multiple translation files for multiple text domains in one plugin. This is sometimes useful, for example when you need just one string in AJAX calls and many strings in the rest of the application: to make AJAX faster, load a separate translation. Be aware, automatic language updates for the plugin from wordpress.org will probably not ...


1

figured it out... The main problem with the scripts so just wrapped them in this for each plugin: function my_enqueue_javascript() { if (is_page('page')) { //Include Javascript library wp_enqueue_script('', plugins_url( '/js/ajax.js' , __FILE__ ) , array( 'jquery' )); // including ajax script in the plugin Myajax.ajaxurl ...


1

I would look into using HyperDB instead. This would allow you to pull data from several databases while one is replicated as the "master" database. http://wordpress.org/plugins/hyperdb/ From the description page of the plugin: It supports: Read and write servers (replication) Configurable priority for reading and writing Local and remote ...


0

I think Stop Spammers plugin is the best that you can get for stopping spammers. Please check this link to know the working of the plugin.


0

OMG, finally, as the code runs from the plugin, the current working directory is set to wp-admin whereas when i run it manually it set for /wp-content/plugins... hope this post will help others.


0

Yes it is working 100%. Here is the total plugin if anyone else needs it... add_filter( 'comment_form_default_fields', 'wpse158195_comment_form_default_fields', 99 ); function wpse158195_comment_form_default_fields( $fields ) { global $current_user; get_currentuserinfo(); $post = get_post( $post_id ); // 'global $post;' may also work here if ( ...


0

There is no native solution for this. I remember there was a third party service specializing in theme analytics, but can't google it up now (might have been discontinued). You should also note that official plugin directory severely prohibits gathering such information without explicit user consent. See the guidelines: No "phoning home" without ...


0

There's probably a way to do this via one of the meta cap filters, but off the top of my head you could use the comments_open filter to check if the currently logged in user is the author of the post and change the output of the comments_open() function accordingly. I'm on the patio, so can't test, but something like this should work: add_filter( ...


0

Probably it's because of this: add_action( 'wp_ajax_my_action', 'my_action_callback' ); add_action( 'wp_ajax_nopriv_my_action', 'my_action_callback' ); You have to add the action for both hooks. Probably the plugin is hooked to the second hook right now.


0

It might be due to another plugin that affects your website only to logged in users. Try to disable them one by one and see if it works.


1

You can get only the category's children. $terms = get_terms( $taxonomy, 'child_of=6' );


0

You are using too many static pages. Pages are hierarchical and wordpress doesn't handle page that well. The same goes for Custom Post Type with hierarchical option set. The only solution here is to ask your host to increase your RAM size. That will solve the problem for now. But if you continue to add too many pages again, you are again to hit the memory ...


1

If you have a function that you cannot change to prevent the premature output, you can still override the shortcode handler: add_shortcode( 'wordpress_social_login', 'wordpress_social_login_fix' ); function wordpress_social_login_fix( $attributes, $content ) { ob_start(); wsl_render_login_form(); return ob_get_clean(); }


1

My first guess is that the values aren't the correct "type". Meaning you might be passing string values when the script expects integers, so try converting the values to integers first. jQuery(document).ready(function(){ var newsPerPage = parseInt( newsbox_parameters.newsPerPage ); var newsTickerInterval = parseInt( ...


1

One way is to have a single front-page.php and then using get_template_part(), to show different content based on user choice. Rough code: get_header(); $layout = get_option( 'front_page_layout', 'default' ); get_template_part( 'front-page', $layout ); get_footer(); After that you need to create a file for every layout, they should be called, something ...


0

Let your plugin create a management page where the user can activate the different custom post types. Highlight the post types that the current theme supports, and explain what exactly that means. It could look like this: Post type Support by Your Cool Theme Name [x] Portfolio Template, search, custom editor fields [x] Event ...


0

You need to capture the attributes that passed to a shortcode. You can do that like this add_shortcode('testimonial', 'testimonial_shortcode_func'); function testimonial_shortcode_func( $atts ) { $atts = shortcode_atts( array( 'style' => 'default_value_if_no_value_is_provided', ), $atts ); if( $atts['style'] == 'fancy' ) { //do ...


0

-1 to the whole idea Breaking up your theme into two parts and calling one of them "plugin" do not solve the theme lock in problem. As long as there is only one theme that can access the CPT content there is a lock in even if in theory others themes can access it. A good CPT in a plugin should be self contained and work across all themes without requiring ...


0

The Custom Post Type won't fail to load just because your theme won't have support for 'custom-portfolio' if you define CPT in your plugin. There is always single.php which will be used if no other template is found. You can provide at least minimal css support from your plugin so that the content is understandable even if they switch theme. You can also ...


0

There is only one option, the page templates one. This is how 99% of the themes work and what wordpress users and implementators are used to. You can try to be unique but no one will appreciate it.


1

You need to check that when you are activating the plugin. WordPress will send a Boolean flag to let your function know that this is a network wide activation. register_activation_hook( __FILE__, 'activate' ); function activate( $network_wide ) { // $network_wide will be TRUE if activation is network wide if ( $network_wide ) { ... Do ...


1

I see the question is already answered. But there is a alternate scenario where you might want to redirect to settings page after a theme installed. You can do it very easily using following codes :) if (is_admin() && isset($_GET['activated'])){ wp_redirect(admin_url("themes.php?page=ot-theme-options")); } You just have to replace the ...


7

WordPress does support making connections using SSH (aka SFTP) via the built in updater system. It got this support in version 2.7, approximately 6 years ago. Reference: https://core.trac.wordpress.org/ticket/7690 If you're not seeing it in the normal "credentials" screen, then this is because your PHP installation lacks the support necessary for it to be ...


0

Based on what I can see, it looks like your calling the create_map function incorrectly. add_shortcode() takes 2 parameters, the name of the shortcode and the function that gets rendered when called. The array you are passing is how to call a method inside of a class. You're basically saying call the create_map method from the hotSpot class. Assuming this ...


0

If the plugin you have downloaded is zipped, unzip the file and upload the folder into your wp-content/plugins folder in the WordPress installation. It should appear in the admin for you to activate.


0

You can restrict access to your wp-login.php (unless of course you want open registration) this would keep out the unwanted registrations. Add something like this to your .htaccess <Files wp-login.php> AuthType Basic AuthName "This Website" AuthUserFile "/path/to/.htpasswds/passwd" require valid-user </Files> You would of course need to add ...


0

Found out how to do it, I added the following in content.php. I added the second elseif statement and simple put the word Document in there before it displays the title of the page. if ( is_single() ) { the_title( '<h1 class="entry-title">', '</h1>' ); } elseif (get_post_type() == 'attachment' ) { the_title( '<h1 ...


0

I can't find any argument of post_type in wp_list_categories() You should use taxonomy instead wp_list_categories( $args = array( 'taxonomy' => 'Carousel' //Carousel is the taxonomy name your plugin use ) );


0

To Get Current User date : $current_user = wp_get_current_user(); $uname = $current_user->user_login; $mylink = $wpdb->get_row("SELECT * FROM mst_customer WHERE username= '$uname' ", ARRAY_A); and then print like this echo $current_user->user_email; To Get Particular user Recod using where condition : ...


1

First, create a function to process the form. In the shortcode function, first process the form and then return any form/message that you want to display to the user. /** * Plugin Name: NewsletterFormConnector * Description: Newsletter Form to connect to Newsletter Api * Author: emjay * Version: 1.0 */ //Add function file ...


0

use: $myrows = $wpdb->get_results( "SELECT id, name FROM mytable" ); then use $myrows in for or foreach loop. Reference WP wpdb class: http://codex.wordpress.org/Class_Reference/wpdb


0

Get record from table data which you want to show. So you get array of all data and that array data using foreach show on your page.


0

Depending on the exact functionality you should use different techniques. If you're allowing post data you would do post meta options (Get_post_meta). User data would be user_meta.. Most all the wordpress database actions are done by submitting through various types of WordPress functions. Sadly without knowing your goal I can't be more specific.


0

Late to the party here but wanted to mention for the benefit of future searchers that we had the same need and built a plugin for cloning/duplicating with all settings intact just like the OP describes. It is called the NS Cloner, and it doesn't add a "Duplicate" action link as described here, but it makes the process almost that easy by creating an ...


0

<?php echo get_the_title( $post_id ); ?> <?php get_post_image($post->ID,'large'); ?> You can customize these to your liking. or just go to http://codex.wordpress.org/Template_Tags/get_posts


1

The post_category needs to be passed as an array of category IDs (even if you're only adding one category). Try this: $post_data["post_category"] = array( $catslug->ID );


2

Instead of using poedit to generate your translation strings from your code, use the WordPress i18n tools to generate a POT file for you. This has the advantages of a) not needing you to do anything special in poedit and b) getting everything that is possible for translation, including headers and non-standard translation string calls (not everything is __ ...


6

You are correct, Wordpress checks for updates to core and plugins every 12 hours, but a better way to word it would be: it checks updates if last update was more than 12 hours ago. The 12 hour setting is hard codded in wp-includes/update.php The last updated dates are stored in wp_options table and the options are: _site_transient_update_core ...


5

The relevant functions wp_update_plugins() and wp_maybe_auto_update() are hooked to the wp-cron events of same name, running on twice daily schedule. Logically the initial schedule will start to tick from the time of first run. Due to wp-cron implementation (not being real cron and trigered by site visits rather than server clock) it will also "drift" ...


1

Ok. I Found the problem. Several tutorials told me to put __() and _e() in my poedit. Which, now I've found the answer is pretty stupid. Because there simply don't exist any strings with these search values. As there is always something in between those brackets. Solution is thus very simple (and quite stupid). Put the search values to __ and _e


0

You can try http://sitecheck.sucuri.net first to see if it tells you anything. I would first run a find and replace on everything. If you can ssh your site toy can do it that way. If you aren't good with the terminal try sublime with http://wbond.net/sublime_packages/sftp. Run find and replace all instances of the malicious code. After you do that disable ...


0

This is malware, maybe injected using some insecure or very old Plug-In. Call your hoster and let him recover the last working backup. Or you have a backup and are able to upload it very soon. If you neither have a proper hoster or a backup on your own, then you really need a professional to help you with that. You should also take a snapshot of the ...


0

The UCC SSL Certificate is used to secure multiple domains like www.example.com, www. example.net, www.example.co.uk etc. and if you want to secure your subdomains like shop.example.com, distributors.example.com and careers.example.com then you should try Unified Communication Wildcard Certificate instead of UCC SSL Certificate because it protects both ...


0

The code was working fine. My problem was that I forgot that I changed the default prefix of the database. Sorry guys for wasting your time. Have a good one


1

I suspect that PHP considers the value of $wpdb->get_row("SELECT * FROM wp_posts WHERE post_title = '" . $title . "'", 'ARRAY_A'); to be true no matter what (see also this). You'll have to count the number of rows that are returned Try something like this instead: $query = "SELECT COUNT(*) FROM wp_posts WHERE post_title = '$title'"; $count = ...


1

OK, you have two problems here. Firstly, you are enqueueing your style with wp_enqueue_script(), which is meant to be used by scripts. You should be using wp_enqueue_style Secondly, you need to understand what functions are loaded when. Plugins are loaded first, child themes second and parent themes last. So you styles gets loaded first, and then the ...


0

After manual update, plugins are deactivated by default. It's like installing a new plugin all over again.


1

1.0.0? Really?! Anyway you could try the print_scripts_array filter: // Hack of wp_prototype_before_jquery() in "wp-includes/script-loader.php" function wpse157295_print_scripts_array( $js_array ) { if ( false === $jquery = array_search( 'jquery-core', $js_array, true ) ) // Now 'jquery-core', not 'jquery' return $js_array; $keys = array( ...



Top 50 recent answers are included