Tag Info

New answers tagged

0

For all my answers I'm assuming you both have the legal rights to use those images and are aware of any implications of duplicate content (SEO etc). That being said there are definitely ways. At what point would you like to scrape images? Regularly? If so look into WP_Cron and automate it. If you just want to scrape the image once you generate a new post, ...


0

This worked for me: [product_category category="YOUR CATEGORY" per_page="8" columns="3" orderby="date" order="desc"]


1

I searched everywhere in post type registration flow but didn't found a right way (using filter or action) to do it. All you can do either register the post type again with a different slug (I prefer) or just run those lines of code which WordPress run to build the rewrite rules in register_post_type. I register this post type with slug book and changed it ...


0

I don't know what you need to do that. If you are creating a custom taxonomy you can just copy your archive.php content copy the whole php in it. Create a new file in your template called "taxonomy-yourcustomtaxonomyname.php" paste the code from archive.php you just copied, and WP will handle the rest :) you can learn more about custom templates for ...


0

I will approach like this: global $current_user; get_currentuserinfo(); $email = (string) $current_user->user_email; var_dump($email); You just called got the email from the current_user array and cast it into string :) that's it


0

If you just need to "Get Current user email as a return string value" then you can simply do this by using following function // Add this function in your functions.php or in your plugin function mm_get_current_user_email(){ global $current_user; get_currentuserinfo(); $email = $current_user->user_email; return $email; } ...


1

The reason is that you can register native PHP functions as callbacks. Passing more parameters to them then they expect will raise a warning. Imagine a filter that can pass 6 parameters and trim() as callback. PHP would now raise an error: Warning: Wrong parameter count for trim() in … Some custom callbacks might also change their behavior depending ...


0

// Add the content to $post as an array $post = array( 'post_title' => $title, 'post_content' => $description, 'post_category' => $_POST['cat'], // Usable for custom taxonomies too 'tags_input' => $tags, 'post_status' => 'draft', // Choose: publish, preview, future, etc. ...


0

I have changed the do_action() for a apply_filter(). This worked as follows: // Filter save settings $settings = apply_filters( 'gtp_theme_settings_tab_save', $settings, $tab, $_POST ); $updated = update_option( 'gtp_theme_settings', $settings ); And then my add_filter in plugin file looks like: function ac_theme_settings_tab_save( $settings, $tab, ...


0

I made some changes in functions.php: function remove_media_tab( $strings ) { if( !current_user_can( 'administrator' ) ) { $strings["createGalleryTitle"] = ""; $strings["setFeaturedImageTitle"] = ""; $strings["insertFromUrlTitle"] = ""; } return $strings; } add_filter( 'media_view_strings', 'remove_media_tab' ); It ...


0

You can use http://php.net/manual/en/function.http-response-code.php to set the response header, and you just need to find the lines in the theme's header.php. Unfortunately, these items are set by header.php so you will have to run the code on all pages of a traditional theme, but I would do something in the header.php near where the meta is currently being ...


0

If you are going to develop this yourself, then it would certainly be recommended to write your own plugin. However, if you have no experience of doing that, you might want to see what is already available. This plugin looks like it might do the job but please note that I have never used it myself. If you do go down the develop-it-yourself route, I would ...


0

Not sure it works now, used it months ago. But you can give a try please file_exists(dirname( __FILE__ ). '/lib/PHPExcel.php');


0

Images should upload in that format when using wp_handle_upload. It is unclear exactly how you are getting http://localhost/job/?attachment_id=40 I would suggest having something similar to the Handling the File Upload section of this post: How can I add an image upload field directly to a custom write panel?


3

Are you calling flush_rewrite_rules at any moment? If you are going to change the slug of a custom post type, you also have to call the flush_rewrite_rules. You can find more documentation here Setting up custom post type archives in WP3.1? Any luck? And here https://codex.wordpress.org/Function_Reference/flush_rewrite_rules


-1

You have to add jquery.form.min.js it work for me , Hope it works for you.


0

Apparently it was the Social Media Widget plugin that caused my issue. In general, to troubleshoot such an issue with the admin page: Disable all plugins. Check that the problem has been solved, i.e., it is a plugin that causes this. Enable one plugin at a time and test, to find the culprit. Disable that plugin. Otherwise, it might be your theme. Like ...


0

The issue I worked out was that I'd previously built another form on my staging site using CCF, I went through phpmyadmin posts and deleted everything ccf-based then rebuilt my form and since there were no previous forms this form was assigned the id 122 and my template now works :) It would still be good to know if there's a way to search for wildcards ...


0

Well it doesn't. It was changed after year 2011 and now (in 2015) you have no options to sort on Wordpress.org or in your WordPress installation.


0

Various possibilities. If fixing a bug, I'll sometimes actually make a patch and send it to the Plugin author. More than once they've added the patch and said thanks. Beyond that, if you really need to hack a plugin, you should also change the folder and header info so that the auto-update doesn't recognize it. Of course you'll not get new updates. ...


0

Your best option is to buy the Gravity Forms plugin in order to accomplish this. http://www.gravityforms.com/ Yes, there are other form plugin options such as Contact Form 7 but I can assure you (and everyone here) that the Gravity Forms plugin is hands down the option for this task.


0

I personnaly use Addthis toolbar, not a plugin so you can put the code where ever you want in your templates. You can go with this basic code : <div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url="<?php the_permalink() ?>" addthis:title="<?php echo get_the_title() ?>"> <a ...


0

login to localhost/phpMyAdmin and create dump of your DB Configure XAMPP and install clean Wordpress Import dump of your old DB to new Wordpress Change site_url and 'homeinwp_options` table Copy all your plugins from plugins folder and themes from themes folder Copy all uploaded files from `uploads' folder Check if everything goes well. Those points are ...


0

To answear my question: It's a typo. `students_email` VARCHAR 850) NOT NULL, should be: `students_email` VARCHAR (50) NOT NULL, Oh the headache. When the typo is corrected it creates a new table.


1

The main issue I was having is that when an ajax request hits not all hooks are being loaded. I used this code: $return = array(); foreach( $GLOBALS['wp_actions'] as $action => $count ) { $return["message"] .= $action . ", "; } wp_send_json($return); This showed me the hooks that were running before and I got it to work. I think removing ajax ...


0

I see a few things missing in your snippet/code. Each field (your location ones) need to include priority: 'priority' => 19, You defined 'type' as 'location' but did not define that field type. The repeated files in resume manager where you based this code on defines template files for education, experience etc. To define your own filter on ...


0

set the product image upload in fullsize then add the code below in functions.php add_image_size( 'thumbnail', 150, 150, array( 'center', 'top' ) );


2

Just for clarity: borrowing from this answer, add the following to your theme's functions.php: function wpse_188427_delete_post_media( $post_id ) { $attachments = get_posts( array( 'post_type' => 'attachment', 'posts_per_page' => -1, 'post_status' => 'any', 'post_parent' => ...


0

if you create your own hook, here is example. // lets say we have three parameters [ https://codex.wordpress.org/Function_Reference/add_filter ] add_filter( 'filter_name', 'my_func', 10, 3 ); my_func( $first, $second, $third ) { // code } then implement hook: // [ https://codex.wordpress.org/Function_Reference/apply_filters ] echo apply_filters( ...


0

It's informative to check out Really Simple Syndication Best Practices Profile . About the <item> tag: An item MAY contain the following child elements: author, category, comments, description, enclosure, guid, link, pubDate, source and title. All of these elements are OPTIONAL but an item MUST contain either a title or description. About ...


1

I'm afraid it's not possible to do it without any plugin. Author's image (gravatar) is not published in RSS, and it's computed based on author's e-mail address, which also is not published in RSS... But if you have control over both of these sites, then you could use JSON API/XML RPC to get the newest blog posts - then you could get all info from these ...


5

You don't, for the same reason you don't modify WordPress Core, you extend it or use hooks and filters to modify its behaviour. So when extending or changing plugins you have 2 options: Forking You've been creating forks of a plugin so far, but it's important to change the name when this happens so your new plugin isn't overwritten. You'll need to ...


1

There is no such child folder, but depending on the type of change, you can write a new plugin to override the code. If it's Revolution Slider, be sure you're reading all the documentation to be sure you actually need to be doing the edits in the first place. Most things you would "need" to change might actually be settings.


0

above is my check box, normally name="book[]" can someone explain what the purpose of the [] is? This is allowing the checked values to be returned as an array when getting the results, if you have more than one value checked. Besides that, I can't tell what you're trying to do in order to be able to answer the other questions. Especially the last ...


0

Tried with this and got the solution add_submenu_page( 'page_main', "Articles", "Articles" , 'adminstrator', 'edit.php?post_type=page_article' ); Thanks


1

Well, it seems SAVEQUERIES is the culprit. After disabling SAVEQUERIES memory usage is down.


1

There are two possible solutions: CSS edit and File edit. CSS edit(Not the best solution, but works) .post-blocks .block-info span { display: none; } It is not possible for us to write the file edit code since we don't have access to your admin panel. Install WhatTheFile plugin to find out the template that renders the code for the page and edit the ...


1

This is a long shot but is there any possibility your text editor is encoding the file in UTF-8 with BOM? Try to save / encode the file in UTF-8 without BOM and see if the issue is gone. As for your plugin header, while it doesn't totally follow the recommended format your header should still be parsed correctly since this is what the main code looks like ...


0

We can different types of fields for 'Resume Manager' & save it. We can achieve this via filter, as follows, //code to add custom field for Resume Manager on front end add_filter( 'submit_resume_form_fields', 'wdm_customize_resume_fields' ); function wdm_customize_resume_fields($fields) { $fields['resume_fields']['candidate_address'] = array( ...


3

They're probably referring to the functions file in your theme, functions.php. This file is loaded by WordPress during setup, and gives you an opportunity to do things or register hooks and filters. Note that this file is optional, and not every theme has a functions.php, if that's the case just create one yourself Keep in mind the only thing that's special ...


1

While I don't know exactly what code is responsible, your last comment-- " It has this uninstall.php inside that plugin's plugin root directory"-- gives me a pretty good idea of what is happening. If the plugin can not be written without running code within the plugin, then the plugin should create a file named 'uninstall.php' in the base plugin ...


0

Try this way: add_action( 'save_post', 'myFunc'); function myFunc(){ if ($post->post_type == 'cpt' ) { // do action here } OR add_action( 'save_post', 'myFunc'); function myFunc(){ if ( 'cpt' == get_post_type() ) { // do action here }


0

If you want a hosted solution that you don't have to manage, check out Kernl (https://kernl.us). Its a service that provides the infrastructure for updating plugins and makes it easy to integrate into your own plugins.


1

Best way for execute any PHP code during development its Console from Developer plugin. You can install Developer plugin, and activate console module. "Debug" link will appear in top right corner in your admin bar. You can go there, and execute any php code you like.


0

This solution should do the job for you. http://tgmpluginactivation.com/ The solution is meant for theme developers to package to download, automatically install and activate multiple plugins that are either packaged with a theme, downloaded from the WordPress Plugin Repository or downloaded elsewhere on the internet (perhaps a private repository. The ...


1

A relatively safe way to do it on even a production site is to make a new page and set it to private then copy the page.php file in your theme and change the title of that file to page-new_page_id.php (replace new_page_id with the id or name of the new page you created) then put your code into the content area of the new page-new_page_id.php file and access ...


0

What you are describing sounds like a typical CRUD app. It is certainly a possibility with WordPress (many things are), but natively it is tuned to working with content rather than forms and data. There probably will be a curve, learning to bend it for CRUD, you might not want to deal with. From the things you named: forms: WP has some elaborate forms on ...


2

Just edit functions.php file in theme's directory which is active and write this somewhere to the end of the file: function prefix_my_dump() { //paste your code here } add_action( 'wp_footer', 'prefix_my_dump' ); That hook 'wp_footer' will be echoing the content somewhere to the end of the page. You can use an other action of course. Check this page ...


4

Context is everything with a question like this. However, since you are talking about a "sandbox" I am going to assume this is thowaway install on a development server and you just want to test bits and pieces of code without much hassle. To do that... I usually drop code into a mu-plugin file-- create a directory in wp-content called mu-plugins. Every ...


1

You need to use a meta_query to query custom fields. If you are going to store date and time in custom fields for the purpose of ordering or comparisons, you will need to store it in the format of yyyy-mm-dd h:m:s or as a unix timestamp. If you have two custom fields start and end and you need to get posts between a cetain start and end date, you can try ...



Top 50 recent answers are included