Tag Info

New answers tagged

0

I suspect that your issue is occuring because the category term events does not yet exist. If the function get_cat_ID() fails it returns 0, and in turn the wp_get_recent_posts() function uses 0 as the default for the category parameter, meaning that the parameter is ignored by the function. To avoid this behaviour I suggest you check for the result of ...


0

My guess would be that your category is invalid or the value passed by category is invalid. wp_get_recent_posts() uses get_posts which uses WP_Query. The behavior of WP_Query is sometimes unexpected. In some cases, instead of returning no posts or a 404 not found error, it will simply return all posts regardless if one of the parameters or its values are ...


1

Yes, you can enable a theme for a single site (as opposed to enabling it for your entire Multisite network). Go to the site's Edit Site backend page and select the Themes tab. The URL should be something like example.com/wp-admin/network/site-themes.php?id=[site ID]. You'll need Super Admin privileges on the Multisite network. Enable the theme(s) you'd ...


0

You could develop your own metabox for the page (with custom styling, probably) that allows selection of the template. I don't know that generating screenshots is feasible, but you could definitely have it pull from some sort of associated file (eg: template name is template-name.php, screenshot is template-name.png). With the replacement selection method ...


0

If you want to do that kind of thing your self, you could add a custom meta box that shows up only on that page template labeled something like "Second Content Area" that the user can enter additional content into for display below the center areas. Another possibility would be to place a (horizontal) sidebar below the middle content and let the user place ...


0

Or you can use another way, may be bit long but will give you full control how you want to drive your site/template. Make responsive CSS. Call desktop styles in tablet view/resolution with media queries and for the smaller device, set styles as you want. This will give you control in a way that you can have totally different layout in portrait and ...


1

Adding a reference to updated @EAMann's answer: I've asked similar question to license@fsf.org. My exact question was: Could you please clarify what does it mean to release source code under "GPLv2 (or later)" and if so, if it allows to release derivate works under aGPL v3. And the answer that came: By licensing their work under GPLv2 (or later), ...


-1

Make sure that you're logged in as admin Goto Settings General Settings Make sure that your site URL is "http://yoursitehere.com" If you have previously changed that it could cause you problems all across the board.


0

There is 3 files in Twentyfifteen´s CSS-folder. But those are "extra" files that are used for specific styling of the editor and old Internet Explorer versions. editor-style.css is used to style the WordPress editor. ie7.css and ie.css are used to style/fix old Internet Explorer layout. The file that is used to style the front-end of your site is ...


0

Go to Dashboard > Appearance > Themes. The active theme is the first one in the list and, depending on your WP version it will say so (in WP 4.1 it is written in the theme-box footer). If none of those themes says "Active", it might be because you have deleted the active theme and WP is loading the fallback theme (twentyfifteen in latest version). Your ...


0

I have achieved same with this: function add_custom_menu_item(){ add_menu_page( 'Menu Item Title', 'Page Title', 'manage_options', 'page_slug', 'function', 'dashicons-icon', 1 ); } add_action( 'admin_menu', 'add_custom_menu_item' ); function custom_menu_item_redirect() { $menu_redirect = isset($_GET['page']) ? $_GET['page'] : false; ...


0

I'll preface this by saying I don't think it's the best of ideas, but in the interest of answering the question... The general idea is to filter template, option_template, and option_stylesheet in a plugin and return your desired template slug. The rest of the code is just setting and reading the cookie. <?php /** * Plugin Name: WPD Theme Switcher */ ...


0

I've struggled with the same thing pretty much always. There's a plugin called File Un-Attach, and a Unattach and Re-attach Media Attachments. See if they work for you. There's also 5 year old Trac ticket on this, but it seems to be under conversation still.


0

Have you looked at October CMS? The only reason I didn't use it for my newest project was because of SEO. Yoast's plugin on WordPress just handles a lot of stuff I don't want to deal with regularly.


1

Combining wordpress with other frameworks will make it very easy for you to shot yourself in the foot. If all what your clients want is an editor then you can just use tinymce without dragging the whole of wordpress into it, but if they are after the workflow and flexibility then it will be pointless to try to make wordpress something that it isn't. you are ...


2

The thing about WordPress, while it doesn't have a neat routing system in principle it does same operation. It takes the URL input and matches it to a set of query variables. The not–neat thing about it is that it uses regular expressions for these not–quite–routes and a lot of them. The total number of rules fluctuates from about a hundred minimum to ...


0

The wp action hook fires pretty early, before the $post object is set. I would suggest using the appropriate hook wp_enqueue_scripts instead, and amending your code to: function profolio_localize_script () { if ( is_singular( 'my-gallery' ) ) { $layoutType = get_post_meta( get_queried_object_id(), 'gallery_layout', true ); // Rest of ...


1

Edit the according template file out of the Template Hierarchy, so in your case the template regarding the Category Display.


0

I call mediaelementplayer() from ajax success function. It works for me. $.get(ajaxPostUrl,function(data){ var posts = $(data).find('.post'); $('#post-container').append(posts); posts.find('video,audio').mediaelementplayer(/* Options */); });


0

I am sure there's an easier way to accomplish this, but this how I would've done. Query all posts with category X and status X Update query results with status Y. $target_category = 'news'; $change_status_from = 'draft'; $change_status_to = 'publish'; $update_query = new WP_Query(array('post_status'=>$change_status_from, ...


1

You are using after_theme_switch action but the correct name is after_switch_theme. Also, you won't see the echo statements on after_theme_switch and switch_theme. To debug things in that hooks you can use, for example, error_log() function and look for messages in PHP error log file (you need to have errors "On" and/or WP_DEBUG enabled). I've tested this ...


0

well your question is a bit confusing because you say you had 192px "Thumbnails" assuming you mean the_post_thumbnail then the actual original image size that you uploaded originally could and would most likely be larger, in which case the regenerate thumbnail plugin would work for you. when you say you can not access featured images inside the header as it ...


0

Theme I had did thinks like (don't know what's the problem here yet): <?php $page_content = get_post(); ?> <h2> <?php echo $page_content->post_title;?> </h2> <div> <?php echo $page_content->post_content;?> </div> echo the_content() didn't do anything. I had to replace a line with <?php echo ...


2

The list you are referring to was done start to mid 2013, which can be a bit outdated as the was major improvements/new feutures like The TINYMCE editor undergone major modifications and upgrades as from version 3.9 Version 4 saw the introduction of new shortcodes like the video shortcode and audio playlist, just to name a few In the back end plenty of new ...


2

I took the following from the rtl.css and applied them via Magic Widget with additional !important keywords to an English site: body:before { right: 0 !important; left: auto !important; } .sidebar { float: right !important; margin-right: auto !important; margin-left: -100% !important; } .site-content { float: right !important; ...


0

Your two options are to add your own stylesheet to redefine the plugin's styles, or remove the plugin's css file entirely by dequeueing the stylesheet (assuming the plugin has correctly added the stylesheet via the API) function wpd_my_theme_css() { // dequeue plugin css with same handle it is enqueued with wp_dequeue_style( 'plugin_css_handle' ); } ...



Top 50 recent answers are included