Tag Info

New answers tagged

0

As another poster pointed out, this is almost always a bad idea for security reasons. If you insist on doing it this is how. Since you are using a custom field that can have both php and html, your best bet is to use a shortcode. Something like this will work: In the file that holds your functions: function wpsc_do_php($atts, $content){ /*Do some ...


0

In principle this is easyliy possible, if you tell your template to evaluate the contents of the field. But this way you are probably going to introduce lots of security problems into your code. In most cases it is not necessary to store php code in db and there is most certainly a better way of solving your problem.


1

It's a UNIX timestamp - with PHP, you can use date to format it like so: echo date( 'd/m/Y', $timestamp ); // day/month/year


0

Yes, custom fields or meta fields are part of WordPress. There are all information you need.


1

Use tis plugin https://wordpress.org/plugins/acategory-dropdown-list/ It may be help you


0

you should use get_post_meta( $post_id, '_custField1', true ); make $single parameter true so it will return a single value.


0

This is how I would do it... $page_list = get_pages(); foreach($page_list as $page) { $post_id = $page->ID; $custArray = array( '_custField1' => get_post_meta( $post_id, '_custField1', true ), '_custField2' => get_post_meta( $post_id, '_custField2', true ), '_custField3' => get_post_meta( $post_id, ...


0

After more research and finally finding the answer, I was correct that there is no code in template php files that generates the menu. While looking into functions.php file I noticed that this theme connects jquery.slicknav.min.js to the page, when I looked into not minified version I figured out that this the code that generates the extra menu at the top of ...


0

So many high voted answers.... time to set the record straight, it is virtually impossible and even if it is,life is probably too short to put an effort into it. The problem is not the obvious wp-* urls, the generator meta etc. The hard problems are with patterns that are associated with wordpress that an home grown system will not bother to implement like ...


0

I believe the issue is this line: if( $post->post_type == 'startups' ) return; Won't your custom posts always have the type startups? Basically you are telling your code that whenever I save my custom post type, ignore my custom fields. You probably meant to have one of the WP reserved types (e.g. revision or attachment) that would prevent your ...


0

Create new file 404.php in your theme. This file will be shown everytime when wordpress doesn't find any page. And in that condition you can use wp_redirect function like this: wp_redirect( home_url( '404' ), 302 ); exit();


4

I gave a +1 to the @webtoure's answer because it gives you the right direction, however I think it lacks some checks. First of all it does not check that the theme that's being activated is a child theme, and does not check that the theme previously active is the parent theme of the child theme being activated. Per my understanding of OP these conditions ...


0

I found solution. Grouping duplicated posts by ID. Just add this code to select query: GROUP BY wp_posts.ID Whole code (maybe it will help someone - not many examples of working pagination with select query around the internet :)): <?php global $wpdb; $date = date("Y-m-d"); $querystr = " SELECT * FROM wp_posts JOIN wp_ftcalendar_events ON ...


1

First of all you are trying to combine both of the tables by post_parent. $wpdb->posts.post_parent = $wpdb->ftcalendar_events.post_parent I guess data in the ftcalendar_events has children of posts table, try $wpdb->posts.ID = $wpdb->ftcalendar_events.post_parent Also you can try joining tables: SELECT * FROM $wpdb->posts JOIN ...


0

Please try replacing print apply_filters( 'taxonomy-images-queried-term-image', '' ); with print apply_filters( 'taxonomy-images-list-the-terms', '' ); For WordPress default post type, I created category.php template and altered your code as below. It is showing category image. You can view the snippet here


0

You can use get_object_taxonomies() as your solution. Returns all the taxonomies for a post type or post object: <?php get_object_taxonomies( $object, $output ); ?> Have you tried anything? something like this? // taxonomy term archives $post_type = get_post_type(); // find out if CPT $taxonomies = get_object_taxonomies($post_type); // Find ...


1

There are a few steps you need to take to add menus, the wordpress way. Register the menu in functions.php using register_nav_menus() Codex Link: https://codex.wordpress.org/Function_Reference/register_nav_menus Example: register_nav_menus( array( 'my_custom_menu' => 'My Custom menu', 'my_other_menu' => 'My Other Menu', ) ); Now you ...


0

If you want to delete all your WordPress website content why not install a new one? Otherwise, you can install a plugin like this one: Bulk Delete where you can delete posts, pages and other elements of the website in bulk.


0

There is a great resource that will explain to you how templating works. http://codex.wordpress.org/Theme_Development#Template_Files Hope this gives you insight.


2

If you want to set which one page is blog page and which one is front page you need to go in administration to the Settings - Reading and there switch "Front page displays" to the "A static page" and below choose the pages.


0

This is mainly because a static link saying Home was added to the menu and then you created another page called home which also showed up in the menu. First let's take care of the static home page setting (if you haven't got that set already) Under Settings and then Reading you'll have the option to select a static page as the homepage and another page as ...


0

Yes you can do that. But it will create link like yoursite.com/wp-content/date/month/file.zip You can even do this by plugin Download manager : https://wordpress.org/plugins/download-manager/ It will be easy to use and maintain


0

To eliminate the active "hover" cursor: Theme Options > Drop down menu > Make parent menu items clickable : disable


0

You can upload the files to the media library. Then copy the links within an entry or wherever you prefer. Clicking on the link, the user can download it.



Top 50 recent answers are included