New answers tagged

0

Add the shortcode to your template like this: <?php echo do_shortcode('[*shortcode here*]'); ?>


0

get_the_content doesn't apply all of the filters that the_content runs before outputting the result. You can fix this by simply using: <?php the_content(); ?> in place of: <?php echo $content; ?> If you look at the source for the_content, you'll see the extra step it performs on what is returned from get_the_content.


0

From your question, it might appear that this problem happens with any theme or plugin that you try to install, but most likely this is not the case -- as only themes or plugins that are coded to establish a secure HTTPS connection with a peer should be able to potentially trigger such an error condition. I find it hardly doubtful that installing from the ...


0

There are two ways to solve this: 1 Keep the mods as they are and use get_theme_mod in stead of get_option 2 Store the mods as options by changing the setting: $wp_customize->add_setting( 'social_link_facebook' , array( 'default' => '', 'type' => 'option' ) );


1

It's outputting the word Array which is self explanatory. Instead of direct echoing it, you will need to turn the array into a string. Try implode, something like: Tags: <?php $my_theme = wp_get_theme(); echo implode(', ', $my_theme->get( 'Tags' ) ); ?>


0

If space were the only problem you could simply enqueue a css file to the admin area with these lines to expand the width of the customizer panel from the usual 300px to 500px: .wp-full-overlay-sidebar {width 500px !important;} .wp-full-overlay.expanded {margin-left:500px !important;} Hey, you could even enqueue a js file to insert a button to toggle ...


2

I was able to figure this out and make it dynamic. I created a variable $template that I put inside the loop, in which I stored the page template. $template = get_post_meta( $post->ID, '_wp_page_template', true ); Then, I utilize this where I need the child pages to show up. <?php include(locate_template($template)); ?> This is working for me ...


1

The question you linked to doesn't quite do what you're wanting - it allows you to get the template assigned to a page you're querying, but what you're actually wanting is to get a page assigned to a particular template. You can do this using the get_pages() function by querying a meta key of the page. Pages/posts can have a range of fields assigned to ...


2

1. By definition The article element represents a complete, or self-contained, composition in a document, page, application, or site and that is, in principle, independently distributable or reusable, e.g., in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, ...


0

If you're already experienced with HTML & CSS, then I'd suggest starting by building pages the way you'd like them and then looking at https://codex.wordpress.org/Template_Tags to see how you can replace key sections of the pages dynamically from WordPress.


0

in my case, there was an error regenerating an image, because the image was too big! so the system did not regenerate smaller versions. you can see this happening, if the execution of the plugin regenerate thumbnails runns too fast on this particular image AND you can see via ftp, that there are NO smaller versions of the image. in this case, simply download ...


0

Simple Method First thing you need to do is add a new menu item in your menu. You can do that by going to Appearance » Menus. You want to add a custom link so give it the label you want. In the URL field, enter the # sign. Once done, click on the Add to Menu button. Save your menu once this custom link is added to the menu. Adding a custom link to the menu ...


0

I am not sure how it does effect the SEO but just to answer this question:- You can not save menu item with javascript:void(0); because WordPress filter the URL using function esc_url() thus removing bad values. And it all happens in Nav Walker class. So you need to alter the URL when WordPress done with filtering and returning final safe HTML. You ...


3

You'll be unable to automatically update the parent Divi theme when it's directory becomes renamed. You can use any of caching​ plugins with CSS minify or/and CSS combine turned ON. This way everybody will see /cache directory instead of the actual theme directory. Or as the alternative, you can update renamed parent theme manually, directory by directory, ...


1

You would have to rename the directory of the Divi theme. However, this could break the theme if there are components that depend on the directory being named Divi. Also, there may be copyright issues.


3

How often are the theme mods changed? A lot in the design phase, maybe a couple of times later on. Always by admins, never by ordinary users, let alone visitors. So, it doesn't make sense to generate the full css at every pageload. A better approach is to generate the css only for the admin and store the result for others. This will reduce the amount of ...


0

Why not build a blog style website first? If you're new to WordPress, it's better to start with something relatively easy, where there are lots of tutorials for. Practicing will give you the skills to reach for something higher, like the list of ambitions you give. If you need all those things you say right now, you're better of with buying a decent ...


1

You can deregister that style in your child theme functions.php function remove_shoreditch_background() { wp_deregister_style('shoreditch-style'); } add_action('wp_enqueue_scripts', 'remove_shoreditch_background'); Or you could remove that action entirely remove_action('wp_enqueue_scripts', 'shoreditch_post_nav_background'); Or you can just ...


1

If your theme fully supports child themes copy template-tags.php to the child theme folder and edit it as needed.


0

At the moment it is simply not possible to have more than panels, sections and controls. Expanding this system would require extensive programming at WP. Given the narrow size of the customizer you could also easily get lost if you have so many nested panels. So it's probably not desirable either.


1

It's not classified as plugins. It's also not a WordPress glossary and often called: Tabs which are built on Settings API and some tricks with $_GET request. There're many Q&As, references you can learn from. This topic seems to be the most relevant one for you. Yes, you can do it with template_include filter. These Q&As may be helpful too.


0

Why not try simply: $SiteOriginOptions = 'a:14:{s:10:"post-types";a:2:{i:0;s:4:"page";i:1;s:4:"post";}s:10:"title-html";s:39:"<h3 ...


0

You could add a hook linked to your dashboard (wp-admin/admin.php): if ( is_admin() ) { echo "<script>alert('popup');</script>"; } I don't recommend changing your admin.php, so add a hook for your function to your theme. https://codex.wordpress.org/Function_Reference/is_admin


1

Something went wrong with your installation. As commented by @Sumit get_header() is a core function and cannot be undefined. To troubleshoot: Reinstall WordPress and enable WP_DEBUG in wp_config.php: define( 'WP_DEBUG', true ); If it is on a live site you might want to use this instead: define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ...


1

WP inherently supports multiple theme directories via register_theme_directory(). However since it requires web–accessible directory you might have to symlink or otherwise muck with it server–side so that all sites pick it up. Up to your configuration how to do it exactly.


1

One alternative approach us to have a PHP file that gets the theme options and outputs the CSS and enqueue that directly instead. eg. wp_enqueue_style('custom-css',trailingslashit(get_template_directory_uri()).'styles.php'); This may seem like a strange thing to do at first, but since actually writing a new file should be done via the WP Filesystem for ...


3

The only directory with guaranteed write access is the upload directory. Everything else might be protected. Nowadays, we deploy sites with Composer, keep everything under version control and create completely new sites with each deploy in order to be able to roll back the deployed site. That means that the directory will be created completely new with ...


9

Best place is the uploads directory - it'll be writable by the server, and it's the defacto directory for storing any user-generated/uploaded files: $dirs = wp_upload_dir(); $path = $dirs['basedir']; // /path/to/wordpress/wp-content/uploads


0

I think the best place to write to is to add a folder in the wp-content folder. Here you can write your css files without it is being overwritten when you have a theme update or have a WP update.


3

Here's one idea, that might need further testing: /** * Cropped header image with the same description/caption as the original image */ add_filter( 'wp_create_file_in_uploads', function( $cropped, $attachment_id ) { add_filter( 'wp_insert_attachment_data', function( $data ) use ( $attachment_id) { if( doing_action( ...


-1

You can create using page builders as well as using widgets or you can use custom post types and create page templates for different pages of your custom WordPress theme website.


0

Have you considered to learn how to develop WordPress sites before working with a client? And you can always go with a child-theme from one of the WordPress default themes or you can start from scratch following this tutorial :)


1

If you want the WordPress framework without the querying, use wp-load.php: require '/path/to/wordpress/wp-load.php';


0

I am not sure this will be suitable to your case but you can try: define('SHORTINIT',true); before including wp-blog-header.php and many things will not load - perhaps the redirect will be one of them? (But, it does mean you may have to include a lot of wp-includes files manually too for many of the WordPress functions to be able to run without fatal ...


1

I think you are referring to starter themes also called skeleton themes. I have used a couple in the passed. Bones Underscore There are many others out there. Try and google: "skeleton theme wordpress" for more results


1

I agree with Mark that it's not the best idea i've ever heard of, but it is easily done, by defering everything to index.php. Start that file as follows: if (is_404() and file_exists (get_template_directory() . '/wp_template_parts/404.php') {get_template_part (get_template_directory() . '/wp_template_parts/404.php');} elseif (is_page() ... and so on ... ...


1

Yes it is a bad idea. There are de facto standards on code organization in themes, and no one likes to figure out the code of someone else that thought that he is smarter than all WP developers before him, even if it is possible code wise to do it differently. So unless you are planning to be the only one ever that works on that theme, please follow ...


-1

Only so much security can be added at the php layer. To gain even more security, modify the .htaccess file, disabling directory browsing, disabling XML-RPC, and deny access to WP-specific files. <files .htaccess> Order allow,deny Deny from all </files> <files readme.html> Order allow,deny Deny ...


0

You can name your theme anything you want. So you can also pretend that an update is a different theme by putting it in a different directory. Hey, you can even upload the exact same theme several times in different directories and WP will think they are different themes. You will, however, run into troubles with the option table in the database. If two ...


0

Read this through: Wordpress Theme Hierarchy Creating custom wordpress themes are fun. You shouldnt be needing to overwrite or rename themes, you could just easily switch between them on your admin panel if the theme files set correctly like (Style.css) /* Theme Name: Your Theme Name Theme URI: URL Author: Most Likely You Author URI: your@email.com ...


0

The name change by itself will not cause any problems, as long as the file header info is unique between them. https://codex.wordpress.org/File_Header Why not use the version meta on the theme and retain the same name and directory structure for the theme? You could also place the files in a proper version control system. Host the theme somewhere like ...


2

Do you understand the bootstrap framework at all? Your theme has implemented a column width that is smaller than you would probably like. Your content area is wrapped in an offset column that is 50% of the container width. <div class="col-lg-6 col-lg-offset-3"> <!-- content --> </div> If you want to increase the width of your ...


-1

Without installing any plugin we can add the social bookmarks. I found following article for this. adding social share buttons without wordpress plugin


1

In author.php: <?php get_template_part('custom-author-file'); Alternatively, rename your custom-author-file.php to author.php. The URL being used in this case isn't relevant, as a template doesn't determine the URL used, it's the other way around. However, I suspect there is more to your question you haven't explained


2

You may want to look at the TwentySixteen theme, which does it this way: In single.php: get_template_part( 'template-parts/content', 'single' ); Several templates are grouped in the 'template-parts' folder. You could use a similar logic for your custom post type. It seems that the technique comes from _underscores.


1

If you have successfully uploaded the theme via FTP into the correct directory it should be available to activate. Things to check: Using your FTP client, you should be able to see the theme directory and all its files under wp_content/themes Make sure the file permissions are correct for WordPress to be able to access the files (you may need to check ...


0

This may be due to a plugin. Try deactivating all plugins by using the plugin screen select all and use the bulk action to disable all. Afterwhich try installing the WP update again and it should work assuming that this was wotking before and it recently stopped.


0

You may want to check what the Codex recommends for file permissions vs. what you are using. http://codex.wordpress.org/Changing_File_Permissions



Top 50 recent answers are included