协助对自定义WP的预制博客文章格式进行更改 [英] Assistance Making Changes To Premade Blog Post Formats From Custom WP

查看:90
本文介绍了协助对自定义WP的预制博客文章格式进行更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从Codestag购买了一个名为Shift的Themeforest的WP主题,它是一个非常易于使用和干净的用户界面。它主要用于博客风格的帖子,他们创建了预制的博客文章样式...



例如,音频帖子是文本和嵌入音频文件。 视频是视频链接和文字,照片显然是照片和文字。



我的问题是这些不可自定义和博客文章的类型我创建的是音频或视频,包括艺术家或专辑封面的照片。我需要添加哪些代码才能使此预制帖子包含照片? (下面的代码)



我的第二个问题是如何更改音频文件,标题,文本到标题,照片文字和音频的顺序?



这是预制博客风格的代码:音频



 <   div     class   =  hentry-inner >  

< div class = entry-wrapper grid >

< ;? php get_template_part(' content' ' meta'); ?>

< div class = entry-content grid-10 clearfix >

<? php
$ embed = get_post_meta(get_the_ID(),' _ stag_audio_embed',true);

if(!empty($ embed)){
echo do_shortcode(htmlspecialchars_decode($ embed));
} else {
stag_audio_player(get_the_ID());
}

?>

< ? php if(is_single()){?>

< h1 class = entry-title > <? php the_title(); ?> < / h1 < span class =code-keyword>>

<? php} else {?>

< < span class =code-leadattribute> h2 class = 条目标题 > < a href = <?php the_permalink();?> rel = 书签 title = <?php printf(__('永久链接到%s','stag'),get_the_title()); ?> > <? php the_title(); ?> < / a > < / h2 >
<? php} ?>

<? php

if(!is_singular()){
if(get_the_excerpt() != ' ' echo < p> .strip_shortcodes(get_the_excerpt())。 < / p>;
} else {
the_content(__(' 继续阅读'' 鹿'));
wp_link_pages(array(' before' => ' < p> ' .__(' Pages:'' stag')。' '
' 在' => ' < / p>'' next_or_number' => ' number'));
}

?>
< / div >
< span class = bottom-accent > < / span >
< / div >
< / div >







非常感谢您的帮助!

-Peter

解决方案

embed = get_post_meta(get_the_ID(),' _ stag_audio_embed',true);

if(!empty(


embed)){
echo do_shortcode(htmlspecialchars_decode (

嵌入));
} else {
stag_audio_player(get_the_ID());
}

?>

< ? php if(is_single()){?>

< h1 class = entry-title > <? php the_title(); ?> < / h1 < span class =code-keyword>>

<? php} else {?>

< < span class =code-leadattribute> h2 class = 条目标题 > < a href = <?php the_permalink();?> rel = 书签 title = <?php printf(__('永久链接到%s','stag'),get_the_title()); ?> > <? php the_title(); ?> < / a > < / h2 >
<? php} ?>

<? php

if(!is_singular()){
if(get_the_excerpt() != ' ' echo < p> .strip_shortcodes(get_the_excerpt())。 < / p>;
} else {
the_content(__(' 继续阅读'' 鹿'));
wp_link_pages(array(' before' => ' < p> ' .__(' Pages:'' stag')。' '
' 在' => ' < / p>'' next_or_number' => ' number'));
}

?>
< / div >
< span class = bottom-accent > < / span >
< / div >
< / div >







非常感谢您的帮助!

-Peter


I have purchased a WP theme from Themeforest by Codestag called Shift and its a pretty easy to use and clean UI. It is mostly for blog style posts and they have created pre-made blog posts styles...

For example, an "Audio" post is text and the enbedded audio file. "Video" is the video link and text, "Photo" is obviously the photo and text.

My problem is that these are not customizable and the type of blog posts I create are either audio or video and include a photo of the artists or album art. What code do I need to add to allow this pre-made post to include a photo? (CODE BELOW)

The second question I have is how can I change the order from Audio file, Title, Text to Title , photo text and audio?

This is the code for the pre-made blog style: "Audio"

<div class="hentry-inner">

  <div class="entry-wrapper grids">

<?php get_template_part('content', 'meta'); ?>

<div class="entry-content grid-10 clearfix">

  <?php
  $embed = get_post_meta(get_the_ID(), '_stag_audio_embed', true);

  if(!empty($embed)){
    echo do_shortcode(htmlspecialchars_decode($embed));
  }else{
    stag_audio_player(get_the_ID());
  }

  ?>

  <?php if( is_single() ) { ?>

    <h1 class="entry-title"><?php the_title(); ?></h1>

  <?php } else { ?>

    <h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'stag'), get_the_title()); ?>"> <?php the_title(); ?></a></h2>
  <?php } ?>

  <?php

    if(!is_singular()){
      if(get_the_excerpt() != '') echo "<p>".strip_shortcodes(get_the_excerpt())."</p>";
    }else{
      the_content(__('Continue Reading', 'stag'));
      wp_link_pages(array('before' => '<p>'.__('Pages:', 'stag').' ',   'after' => '</p>', 'next_or_number' => 'number'));
    }

  ?>
</div>
 <span class="bottom-accent"></span>
  </div>
</div>




Much thanks in advance for the help!
-Peter

解决方案

embed = get_post_meta(get_the_ID(), '_stag_audio_embed', true); if(!empty(


embed)){ echo do_shortcode(htmlspecialchars_decode(


embed)); }else{ stag_audio_player(get_the_ID()); } ?> <?php if( is_single() ) { ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php } else { ?> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'stag'), get_the_title()); ?>"> <?php the_title(); ?></a></h2> <?php } ?> <?php if(!is_singular()){ if(get_the_excerpt() != '') echo "<p>".strip_shortcodes(get_the_excerpt())."</p>"; }else{ the_content(__('Continue Reading', 'stag')); wp_link_pages(array('before' => '<p>'.__('Pages:', 'stag').' ', 'after' => '</p>', 'next_or_number' => 'number')); } ?> </div> <span class="bottom-accent"></span> </div> </div>




Much thanks in advance for the help!
-Peter


这篇关于协助对自定义WP的预制博客文章格式进行更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆